[
  {
    "path": ".codesandbox/ci.json",
    "content": "{\n  \"packages\": [\"packages/react-native-web\", \"packages/babel-plugin-react-native-web\"],\n  \"buildCommand\": \"build\",\n  \"sandboxes\": [\"/packages/react-native-web-examples/\"],\n  \"node\": \"16\"\n}\n"
  },
  {
    "path": ".github/CONTRIBUTING.md",
    "content": "# Contributing\n\n## Reporting Issues and Asking Questions\n\nBefore opening an issue, please search the [issue tracker](https://github.com/necolas/react-native-web/issues) to make sure your issue hasn't already been reported. Please note that your issue may be closed if it doesn't include the information requested in the issue template.\n\n## Getting started\n\nVisit the [Issue tracker](https://github.com/necolas/react-native-web/issues) to find a list of open issues that need attention.\n\nFork, then clone the repo:\n\n```\ngit clone https://github.com/your-username/react-native-web.git\n```\n\nInstall dependencies (requires Node.js >= 16.0):\n\n```\nnpm install\n```\n\n## Build\n\nBuild a specific package:\n\n```\nnpm run build -w <package-name>\n```\n\nFor example, this will build `react-native-web`:\n\n```\nnpm run build -w react-native-web\n```\n\nBuild all packages that can be built:\n\n```\nnpm run build\n```\n\n## Develop\n\nDevelop a specific package:\n\n```\nnpm run dev -w <package-name>\n```\n\nFor example, this command will watch and rebuild the `react-native-web` package:\n\n```\nnpm run dev -w react-native-web\n```\n\nAnd this command will watch and rebuild the `react-native-web-examples` package:\n\n```\nnpm run dev -w react-native-web-examples\n```\n\n## Test\n\nRun the monorepo linter:\n\n```\nnpm run lint\n```\n\nRun the monorepo type checker:\n\n```\nnpm run flow\n```\n\nRun the monorepo unit tests:\n\n```\nnpm run unit\n```\n\nRun all the automated tests:\n\n```\nnpm run test\n```\n\n## New Features\n\nPlease open an issue with a proposal for a new feature or refactoring before starting on the work. We don't want you to waste your efforts on a pull request that we won't want to accept.\n\n## Pull requests\n\n**Before submitting a pull request**, please make sure the following is done:\n\n1. Fork the repository and create your branch from `master`.\n2. If you've added code that should be tested, add tests!\n3. If you've changed APIs, update the documentation.\n4. Ensure the tests pass (`npm run test`).\n\nYou should see a pre-commit hook run before each commit.\n\nYou can now submit a pull request, referencing any issues it addresses.\n\nPlease try to keep your pull request focused in scope and avoid including unrelated commits.\n\nAfter you have submitted your pull request, it's recommended that **you** perform the first code review. We'll try to get back to you as soon as possible and may suggest changes.\n\nThank you for contributing!\n\n## Releases\n\nTo commit, publish, and push a final version:\n\n```\nnpm run release -- <version> --otp=<otp-code>\n```\n\nRelease candidates or versions that you'd like to publish to npm, but do not want to produce a commit and push it to GitHub:\n\n```\nnpm run release -- <version> --skip-git\n```\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug.yml",
    "content": "name: Bug report\ndescription: File a bug report\nlabels: [\"bug\"]\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        Thank you for reporting an issue! Create a test case for your issue by forking this template https://codesandbox.io/s/6lx6ql1w5r\n  - type: checkboxes\n    attributes:\n      label: Is there an existing issue for this?\n      description: Please search to see if an issue already exists for the bug you encountered.\n      options:\n      - label: I have searched the existing issues\n        required: true\n  - type: textarea\n    attributes:\n      label: Describe the issue\n      description: Please provide a concise description of what you're experiencing. Providing screenshots is also helpful.\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Expected behavior\n      description: Please provide a concise description of what you expected to happen.\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Steps to reproduce\n      description: Please describe the precise steps needed to reproduce the behavior.\n      placeholder: |\n        Mention package versions and environment (browser, etc)...\n        1. ...\n        2. ...\n    validations:\n      required: true\n  - type: input\n    attributes:\n      label: Test case\n      description: Please provide a link to a reduced test case that reproduces the issue.\n      placeholder: \"https://codesandbox.io/s/6lx6ql1w5r\"\n    validations:\n      required: true\n  - type: textarea\n    attributes:\n      label: Additional comments\n      description: You're welcome to provide additional context and proposed solutions.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature.yml",
    "content": "name: Feature request\ndescription: If you have a suggestion…\nlabels: [\"enhancement\"]\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        Thank you for suggesting a feature!\n  - type: checkboxes\n    attributes:\n      label: Is there an existing request?\n      description: Please search open and closed issues to see if this request has already been made.\n      options:\n      - label: I have searched for this request\n        required: true\n  - type: textarea\n    attributes:\n      label: Describe the feature request\n      description: Please provide a concise description of the request, potential solutions, and additional context.\n    validations:\n      required: true\n"
  },
  {
    "path": ".github/labels-config.yml",
    "content": "# Configuration for Label Actions - https://github.com/marketplace/actions/label-actions\n\n\"needs: issue template\":\n  comment: >\n    <strong>:warning: This issue is missing required fields</strong>. To avoid this issue being closed, please provide the required information as described in the <a href=\"https://github.com/necolas/react-native-web/blob/master/.github/ISSUE_TEMPLATE/bug.yml\">ISSUE TEMPLATE</a>.\n\n\"resolution: no response\":\n  comment: >\n    This issue is being closed because the requested information has not been provided.\n  close: true\n"
  },
  {
    "path": ".github/workflows/labels.yml",
    "content": "name: labels\n\non:\n  issues:\n    types: [labeled, unlabeled]\n  pull_request:\n    types: [labeled, unlabeled]\n\npermissions:\n  contents: read\n  issues: write\n  pull-requests: write\n\njobs:\n  label-actions:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: dessant/label-actions@v3\n        with:\n          config-path: .github/labels-config.yml\n          github-token: ${{ github.token }}\n"
  },
  {
    "path": ".github/workflows/performance.yml",
    "content": "name: performance\n\non: [pull_request]\n\njobs:\n  compressed-size:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v3\n    - uses: necolas/compressed-size-action@master\n      with:\n        build-script: \"compile\"\n        exclude: \"./packages/react-native-web/dist/cjs/{index.js,**/*.js}\"\n        pattern: \"./packages/react-native-web/dist/{index.js,**/*.js}\"\n        repo-token: \"${{ secrets.GITHUB_TOKEN }}\"\n"
  },
  {
    "path": ".github/workflows/react-integration.yml",
    "content": "name: react@next integration\n\non:\n  schedule:\n    # Run every Monday at 12:00 (see https://crontab.guru)\n    - cron: '0 12 * * 1'\n\njobs:\n  react-next:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v3\n    - uses: actions/setup-node@v3\n      with:\n        node-version: 16\n    - run: npm install\n    # Update react-native-web to use react@next\n    - run: npm install --force react@next react-dom@next -w react-native-web\n    # Run the unit tests\n    - run: npm run unit\n"
  },
  {
    "path": ".github/workflows/tests.yml",
    "content": "name: tests\n\non:\n  push:\n    branches:\n      - \"master\"\n  pull_request:\n    types: [opened, synchronize, reopened]\n\njobs:\n  format:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v3\n    - uses: actions/setup-node@v3\n      with:\n        node-version: 16\n    - run: npm install\n    - run: npm run format\n\n  type-check:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v3\n    - uses: actions/setup-node@v3\n      with:\n        node-version: 16\n    - run: npm install\n    - run: npm run flow\n\n  lint:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v3\n    - uses: actions/setup-node@v3\n      with:\n        node-version: 16\n    - run: npm install\n    - run: npm run lint\n\n  unit-test:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v3\n    - uses: actions/setup-node@v3\n      with:\n        node-version: 16\n    - run: npm install\n    - run: npm run unit\n"
  },
  {
    "path": ".gitignore",
    "content": ".next\nbuild\ncoverage\ndist\nnode_modules\n"
  },
  {
    "path": ".watchmanconfig",
    "content": "{}\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) Nicolas Gallagher.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# Development monorepo\n\nThis is the development monorepo for \"React Native for Web\" and related projects.\n\n## Structure\n\n* `.github`\n  * Contains workflows used by GitHub Actions.\n  * Contains issue templates.\n* `configs`\n  * Contains configuration files used by the monorepo tooling (compiling, linting, testing, etc.)\n* `packages`\n  * [react-native-web](https://github.com/necolas/react-native-web/blob/master/packages/react-native-web)\n  * Contains the individual packages managed in the monorepo.\n* `scripts`\n  * Contains Node.js scripts for miscellaneous tasks.\n\n## Tasks\n\n* `build`\n  * Use `npm run build` to run the build script in every package.\n  * Use `npm run build -w <package-name>` to run the build script for a specific package.\n* `dev`\n  * Use `npm run dev` to run the dev script in every package.\n  * Use `npm run dev -w <package-name>` to run the dev script for a specific package.\n* `test`\n  * Use `npm run test` to run tests for every package.\n\nMore details can be found in the contributing guide below.\n\n## Contributing\n\nDevelopment happens in the open on GitHub and we are grateful for contributions including bugfixes, improvements, and ideas.\n\n### Code of conduct\n\nThis project expects all participants to adhere to Meta's OSS [Code of Conduct][code-of-conduct]. Please read the full text so that you can understand what actions will and will not be tolerated.\n\n### Contributing guide\n\nRead the [contributing guide][contributing-url] to learn about the development process, how to propose bugfixes and improvements, and how to build and test your changes to React Native for Web.\n\n### Good first issues\n\nTo help you get you familiar with the contribution process, there is a list of [good first issues][good-first-issue-url] that contain bugs which have a relatively limited scope. This is a great place to get started.\n\n[contributing-url]: https://github.com/necolas/react-native-web/blob/master/.github/CONTRIBUTING.md\n[good-first-issue-url]: https://github.com/necolas/react-native-web/labels/good%20first%20issue\n[code-of-conduct]: https://opensource.fb.com/code-of-conduct/\n"
  },
  {
    "path": "configs/.eslintignore",
    "content": "coverage\ndist\nflow-typed\nnode_modules\npackages/**/vendor/*\npackages/**/.next\n"
  },
  {
    "path": "configs/.eslintrc",
    "content": "{\n  \"settings\": {\n    \"react\": {\n      \"pragma\": \"React\",\n      \"version\": \"18.0\",\n      \"flowVersion\": \"0.148.0\" // Flow version\n    }\n  },\n  // babel parser to support ES6/7 features\n  \"parser\": \"@babel/eslint-parser\",\n  \"parserOptions\": {\n    \"ecmaVersion\": 7,\n    \"ecmaFeatures\": {\n      \"experimentalObjectRestSpread\": true,\n      \"jsx\": true\n    },\n    \"requireConfigFile\": false,\n    \"sourceType\": \"module\"\n  },\n  \"extends\": [\n    \"plugin:flowtype/recommended\",\n    \"prettier\"\n  ],\n  \"plugins\": [\n    \"flowtype\",\n    \"promise\",\n    \"react\",\n    \"react-hooks\"\n  ],\n  \"env\": {\n    \"browser\": true,\n    \"es6\": true,\n    \"jest\": true,\n    \"node\": true\n  },\n  \"ignorePatterns\": [\n    \"coverage\",\n    \"dist\",\n    \"flow-typed\",\n    \"node_modules\",\n    \"packages/**/vendor/*\",\n    \"packages/**/.next\"\n  ],\n  \"globals\": {\n\n  },\n  \"rules\": {\n    \"camelcase\": 0,\n    \"constructor-super\": 2,\n    \"default-case\": [2, { \"commentPattern\": \"^no default$\" }],\n    \"eqeqeq\": [2, \"allow-null\"],\n    \"handle-callback-err\": [2, \"^(err|error)$\" ],\n    \"new-cap\": [2, { \"newIsCap\": true, \"capIsNew\": false }],\n    \"no-alert\": 1,\n    \"no-array-constructor\": 2,\n    \"no-caller\": 2,\n    \"no-case-declarations\": 2,\n    \"no-class-assign\": 2,\n    \"no-cond-assign\": 2,\n    \"no-const-assign\": 2,\n    \"no-control-regex\": 2,\n    \"no-debugger\": 2,\n    \"no-delete-var\": 2,\n    \"no-dupe-args\": 2,\n    \"no-dupe-class-members\": 2,\n    \"no-dupe-keys\": 2,\n    \"no-duplicate-case\": 2,\n    \"no-empty-character-class\": 2,\n    \"no-empty-pattern\": 2,\n    \"no-eval\": 2,\n    \"no-ex-assign\": 2,\n    \"no-extend-native\": 2,\n    \"no-extra-bind\": 2,\n    \"no-extra-boolean-cast\": 2,\n    \"no-fallthrough\": 2,\n    \"no-floating-decimal\": 2,\n    \"no-func-assign\": 2,\n    \"no-implied-eval\": 2,\n    \"no-inner-declarations\": [2, \"functions\"],\n    \"no-invalid-regexp\": 2,\n    \"no-irregular-whitespace\": 2,\n    \"no-iterator\": 2,\n    \"no-label-var\": 2,\n    \"no-labels\": [2, { \"allowLoop\": false, \"allowSwitch\": false }],\n    \"no-lone-blocks\": 2,\n    \"no-loop-func\": 2,\n    \"no-multi-str\": 2,\n    \"no-native-reassign\": 2,\n    \"no-negated-in-lhs\": 2,\n    \"no-new\": 2,\n    \"no-new-func\": 2,\n    \"no-new-object\": 2,\n    \"no-new-require\": 2,\n    \"no-new-symbol\": 2,\n    \"no-new-wrappers\": 2,\n    \"no-obj-calls\": 2,\n    \"no-octal\": 2,\n    \"no-octal-escape\": 2,\n    \"no-path-concat\": 2,\n    \"no-proto\": 2,\n    \"no-redeclare\": 2,\n    \"no-regex-spaces\": 2,\n    \"no-return-assign\": [2, \"except-parens\"],\n    \"no-script-url\": 2,\n    \"no-self-assign\": 2,\n    \"no-self-compare\": 2,\n    \"no-sequences\": 2,\n    \"no-shadow-restricted-names\": 2,\n    \"no-sparse-arrays\": 2,\n    \"no-this-before-super\": 2,\n    \"no-throw-literal\": 2,\n    \"no-undef\": 2,\n    \"no-undef-init\": 2,\n    \"no-unexpected-multiline\": 2,\n    \"no-unmodified-loop-condition\": 2,\n    \"no-unneeded-ternary\": [2, { \"defaultAssignment\": false }],\n    \"no-unreachable\": 2,\n    \"no-unsafe-finally\": 2,\n    \"no-unused-vars\": [2, { \"vars\": \"all\", \"args\": \"none\" }],\n    \"no-useless-call\": 2,\n    \"no-useless-computed-key\": 2,\n    \"no-useless-concat\": 2,\n    \"no-useless-constructor\": 2,\n    \"no-useless-escape\": 2,\n    \"no-var\": 2,\n    \"no-with\": 2,\n    \"prefer-const\": 2,\n    \"prefer-rest-params\": 2,\n    \"quotes\": [2, \"single\", { \"avoidEscape\": true, \"allowTemplateLiterals\": true }],\n    \"radix\": 2,\n    \"use-isnan\": 2,\n    \"valid-typeof\": 2,\n    \"yoda\": [2, \"never\"],\n\n    // flow\n    \"flowtype/generic-spacing\": 0,\n    \"flowtype/space-after-type-colon\": 0,\n\n    // promise\n    \"promise/param-names\": 2,\n\n    // react\n    \"react/display-name\": 0,\n    \"react/jsx-no-bind\": 0,\n    \"react/jsx-no-duplicate-props\": 2,\n    \"react/jsx-no-undef\": 2,\n    \"react/jsx-pascal-case\": 2,\n    \"react/jsx-sort-props\": 2,\n    \"react/jsx-uses-react\": 2,\n    \"react/jsx-uses-vars\": 2,\n    \"react/no-did-mount-set-state\": 0,\n    \"react/no-did-update-set-state\": 2,\n    \"react/no-direct-mutation-state\": 2,\n    \"react/no-multi-comp\": 0,\n    \"react/no-string-refs\": 2,\n    \"react/no-unknown-property\": 2,\n    \"react/prefer-es6-class\": 2,\n    \"react/prop-types\": 0,\n    \"react/react-in-jsx-scope\": 0,\n    \"react/self-closing-comp\": 2,\n    \"react/sort-comp\": 0,\n    \"react/sort-prop-types\": 2,\n    \"react/wrap-multilines\": 0,\n\n    // react-hooks\n    \"react-hooks/rules-of-hooks\": \"error\",\n    \"react-hooks/exhaustive-deps\": \"warn\"\n  }\n}\n"
  },
  {
    "path": "configs/.flowconfig",
    "content": "[version]\n0.148.0\n\n[ignore]\n<PROJECT_ROOT>/.*/__tests__/.*\n<PROJECT_ROOT>/packages/.*/dist/.*\n<PROJECT_ROOT>/packages/react-native-web-docs/.*\n<PROJECT_ROOT>/packages/react-native-web-examples/.*\n\n[include]\n\n[declarations]\n.*/node_modules/.*\n\n[libs]\n\n[options]\nindexed_access=true\nmunge_underscores=true\n"
  },
  {
    "path": "configs/.prettierignore",
    "content": "../coverage\n../**/dist\n../flow-typed\n../node_modules\n../packages/**/vendor/*\n../packages/**/.next\n"
  },
  {
    "path": "configs/babel.config.js",
    "content": "const createConfig = ({ modules }) => {\n  const plugins = [\n    '@babel/plugin-transform-flow-strip-types',\n    ['@babel/plugin-proposal-class-properties', { loose: true }],\n    ['@babel/plugin-proposal-object-rest-spread', { useBuiltIns: true }],\n    '@babel/plugin-proposal-nullish-coalescing-operator',\n    [\n      '@babel/plugin-transform-runtime',\n      {\n        version: '7.18.6'\n      }\n    ]\n  ].concat(modules ? ['babel-plugin-add-module-exports'] : []);\n\n  return {\n    assumptions: {\n      iterableIsArray: true\n    },\n    comments: true,\n    presets: [\n      [\n        '@babel/preset-env',\n        {\n          loose: true,\n          modules,\n          exclude: ['transform-typeof-symbol'],\n          targets: {\n            browsers: [\n              'chrome 49',\n              // https://www.mozilla.org/en-US/firefox/all/#product-desktop-esr\n              'firefox 91',\n              'ios_saf 10',\n              'safari 10',\n              // https://docs.microsoft.com/en-us/DeployEdge/microsoft-edge-support-lifecycle\n              'edge 94',\n              'opera 36'\n            ]\n          }\n        }\n      ],\n      '@babel/preset-react',\n      '@babel/preset-flow'\n    ],\n    plugins: plugins\n  };\n};\n\nmodule.exports = function (api) {\n  if (api) {\n    api.cache(true);\n  }\n\n  return process.env.BABEL_ENV === 'commonjs' || process.env.NODE_ENV === 'test'\n    ? createConfig({ modules: 'commonjs' })\n    : createConfig({ modules: false });\n};\n"
  },
  {
    "path": "configs/husky/pre-commit",
    "content": "#!/usr/bin/env sh\n. \"$(dirname -- \"$0\")/_/husky.sh\"\n\nnpx --no lint-staged\n"
  },
  {
    "path": "configs/jest-setupFiles.dom.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n// JSDOM doesn't implement ResizeObserver\nclass ResizeObserver {\n  disconnect() {}\n  observe() {}\n  unobserve() {}\n}\nwindow.ResizeObserver = ResizeObserver;\n\n// JSDOM doesn't provide values for 'clientWidth' etc\nObject.defineProperty(window.document.documentElement, 'clientHeight', {\n  get: function () {\n    return this._jsdomClientWidth || window.innerHeight;\n  }\n});\nObject.defineProperty(window.document.documentElement, 'clientWidth', {\n  get: function () {\n    return this._jsdomClientWidth || window.innerWidth;\n  }\n});\n"
  },
  {
    "path": "configs/jest.config.js",
    "content": "'use strict';\n\nconst babelConfig = require('./babel.config.js');\n\nmodule.exports = {\n  coveragePathIgnorePatterns: [\n    '/node_modules/',\n    '<rootDir>/packages/react-native-web/src/vendor/'\n  ],\n  fakeTimers: {\n    enableGlobally: true\n  },\n  modulePathIgnorePatterns: [\n    '<rootDir>/packages/benchmarks/',\n    '<rootDir>/packages/react-native-web-docs/',\n    '<rootDir>/packages/react-native-web-examples/',\n    '<rootDir>/packages/react-native-web/dist/'\n  ],\n  rootDir: process.cwd(),\n  roots: ['<rootDir>/packages'],\n  setupFiles: [require.resolve('./jest-setupFiles.dom.js')],\n  snapshotFormat: {\n    printBasicPrototype: false\n  },\n  testEnvironment: 'jsdom',\n  testMatch: ['**/__tests__/**/?(*-)+(spec|test).[jt]s?(x)'],\n  transform: {\n    '\\\\.[jt]sx?$': ['babel-jest', babelConfig()]\n  }\n};\n"
  },
  {
    "path": "configs/jest.config.node.js",
    "content": "'use strict';\n\nconst babelConfig = require('./babel.config.js');\n\nmodule.exports = {\n  coveragePathIgnorePatterns: [\n    '/node_modules/',\n    '<rootDir>/packages/react-native-web/src/vendor/'\n  ],\n  fakeTimers: {\n    enableGlobally: true\n  },\n  modulePathIgnorePatterns: [\n    '<rootDir>/packages/benchmarks/',\n    '<rootDir>/packages/react-native-web-docs/',\n    '<rootDir>/packages/react-native-web-examples/',\n    '<rootDir>/packages/react-native-web/dist/'\n  ],\n  rootDir: process.cwd(),\n  roots: ['<rootDir>/packages'],\n  snapshotFormat: {\n    printBasicPrototype: false\n  },\n  testEnvironment: 'node',\n  testMatch: ['**/__tests__/**/?(*-)+(spec|test).node.[jt]s?(x)'],\n  transform: {\n    '\\\\.[jt]sx?$': ['babel-jest', babelConfig()]\n  }\n};\n"
  },
  {
    "path": "flow-typed/npm/create-react-class_v15.x.x.js",
    "content": "// flow-typed signature: 59a949eac1b23f4800e93fe3c647f055\n// flow-typed version: c6154227d1/create-react-class_v15.x.x/flow_>=v0.104.x\n\ndeclare module \"create-react-class\" {\n  declare module.exports: React$CreateClass;\n}\n"
  },
  {
    "path": "flow-typed/npm/prop-types_v15.x.x.js",
    "content": "// flow-typed signature: c93a723cbeb4d2f95d6a472157f6052f\n// flow-typed version: 61b795e5b6/prop-types_v15.x.x/flow_>=v0.104.x\n\ntype $npm$propTypes$ReactPropsCheckType = (\n  props: any,\n  propName: string,\n  componentName: string,\n  href?: string\n) => ?Error;\n\n// Copied from: https://github.com/facebook/flow/blob/0938da8d7293d0077fbe95c3a3e0eebadb57b012/lib/react.js#L433-L449\ndeclare module 'prop-types' {\n  declare var array: React$PropType$Primitive<Array<any>>;\n  declare var bool: React$PropType$Primitive<boolean>;\n  declare var func: React$PropType$Primitive<(...a: Array<any>) => mixed>;\n  declare var number: React$PropType$Primitive<number>;\n  declare var object: React$PropType$Primitive<{ +[string]: mixed, ... }>;\n  declare var string: React$PropType$Primitive<string>;\n  declare var symbol: React$PropType$Primitive<Symbol>;\n  declare var any: React$PropType$Primitive<any>;\n  declare var arrayOf: React$PropType$ArrayOf;\n  declare var element: React$PropType$Primitive<any>;\n  declare var elementType: React$PropType$Primitive<any>;\n  declare var instanceOf: React$PropType$InstanceOf;\n  declare var node: React$PropType$Primitive<any>;\n  declare var objectOf: React$PropType$ObjectOf;\n  declare var oneOf: React$PropType$OneOf;\n  declare var oneOfType: React$PropType$OneOfType;\n  declare var shape: React$PropType$Shape;\n\n  declare function checkPropTypes<V>(\n    propTypes: { [key: $Keys<V>]: $npm$propTypes$ReactPropsCheckType, ... },\n    values: V,\n    location: string,\n    componentName: string,\n    getStack: ?() => ?string\n  ): void;\n}\n"
  },
  {
    "path": "flow-typed/npm/styleq.js",
    "content": "type CompiledStyle = {\n  $$css: boolean,\n  [key: string]: string,\n};\n\ntype InlineStyle = {\n  [key: string]: mixed,\n};\n\ntype EitherStyle = CompiledStyle | InlineStyle;\n\ntype StylesArray<+T> = T | $ReadOnlyArray<StylesArray<T>>;\ntype Styles = StylesArray<EitherStyle | false | void>;\ntype Style<+T = EitherStyle> = StylesArray<false | ?T>;\n\ntype StyleqOptions = {\n  disableCache?: boolean,\n  disableMix?: boolean,\n  transform?: (EitherStyle) => EitherStyle,\n};\n\ntype StyleqResult = [string, InlineStyle | null];\ntype Styleq = (styles: Styles) => StyleqResult;\n\ntype IStyleq = {\n  (...styles: $ReadOnlyArray<Styles>): StyleqResult,\n  factory: (options?: StyleqOptions) => Styleq,\n};\n\ndeclare module \"styleq\" {\n  declare module.exports: {\n    styleq: IStyleq\n  };\n}\n\ndeclare module \"styleq/transform-localize-style\" {\n  declare module.exports: {\n    localizeStyle: (style: EitherStyle, isRTL: boolean) => EitherStyle\n  };\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"private\": true,\n  \"version\": \"0.0.0\",\n  \"name\": \"react-ui-monorepo\",\n  \"scripts\": {\n    \"clean\": \"del-cli ./packages/*/dist\",\n    \"build\": \"npm run clean && npm run build --workspaces --if-present\",\n    \"compile\": \"npm run build\",\n    \"dev\": \"npm run dev --workspaces --if-present\",\n    \"flow\": \"flow --flowconfig-name ./configs/.flowconfig\",\n    \"format\": \"prettier --check --ignore-path ./configs/.prettierignore \\\"**/*.js\\\"\",\n    \"format:fix\": \"prettier --write --ignore-path ./configs/.prettierignore \\\"**/*.js\\\"\",\n    \"lint\": \"eslint configs packages scripts --config ./configs/.eslintrc\",\n    \"lint:fix\": \"npm run lint -- --fix\",\n    \"prerelease\": \"npm run test && npm run build\",\n    \"release\": \"node ./scripts/releaseReactNativeWebPackages.js\",\n    \"release:benchmarks\": \"git checkout gh-pages && rm -rf ./docs/benchmarks && mv packages/benchmarks/dist ./docs/benchmarks && git add -A && git commit -m \\\"Deploy benchmarks\\\" && git push origin gh-pages && git checkout -\",\n    \"release:react-native-web-docs\": \"git checkout gh-pages && rm -rf ./docs && mv packages/react-native-web-docs/dist ./docs && git add ./docs && git commit -m \\\"Deploy documentation\\\" && git push origin gh-pages && git checkout -\",\n    \"postrelease\": \"npm run release:react-native-web-docs && npm run release:benchmarks\",\n    \"prepare\": \"husky install configs/husky\",\n    \"test\": \"npm run flow && npm run format && npm run lint && npm run unit --runInBand\",\n    \"unit\": \"npm-run-all \\\"unit:* {@}\\\" --\",\n    \"unit:dom\": \"jest --config ./configs/jest.config.js\",\n    \"unit:node\": \"jest --config ./configs/jest.config.node.js\"\n  },\n  \"devDependencies\": {\n    \"@babel/cli\": \"^7.18.6\",\n    \"@babel/core\": \"^7.18.6\",\n    \"@babel/eslint-parser\": \"^7.18.2\",\n    \"@babel/plugin-proposal-class-properties\": \"^7.18.6\",\n    \"@babel/plugin-proposal-nullish-coalescing-operator\": \"^7.18.6\",\n    \"@babel/plugin-proposal-object-rest-spread\": \"^7.18.6\",\n    \"@babel/plugin-transform-runtime\": \"^7.18.6\",\n    \"@babel/preset-env\": \"^7.18.6\",\n    \"@babel/preset-flow\": \"^7.18.6\",\n    \"@babel/preset-react\": \"^7.18.6\",\n    \"@testing-library/react\": \"^16.3.0\",\n    \"babel-eslint\": \"^10.1.0\",\n    \"babel-jest\": \"^29.7.0\",\n    \"babel-plugin-add-module-exports\": \"^1.0.4\",\n    \"babel-plugin-transform-react-remove-prop-types\": \"^0.4.24\",\n    \"caniuse-api\": \"^3.0.0\",\n    \"cross-env\": \"^7.0.3\",\n    \"del-cli\": \"^4.0.1\",\n    \"eslint\": \"^8.19.0\",\n    \"eslint-config-prettier\": \"^8.5.0\",\n    \"eslint-plugin-flowtype\": \"^8.0.3\",\n    \"eslint-plugin-promise\": \"^6.0.0\",\n    \"eslint-plugin-react\": \"^7.30.1\",\n    \"eslint-plugin-react-hooks\": \"^4.6.0\",\n    \"flow-bin\": \"0.148.0\",\n    \"gen-flow-files\": \"^0.4.11\",\n    \"glob\": \"^8.0.3\",\n    \"husky\": \"^8.0.0\",\n    \"jest\": \"^29.7.0\",\n    \"jest-environment-jsdom\": \"^29.7.0\",\n    \"lint-staged\": \"^13.0.3\",\n    \"minimist\": \"^1.2.6\",\n    \"npm-run-all\": \"^4.1.3\",\n    \"prettier\": \"^2.7.1\"\n  },\n  \"workspaces\": [\n    \"packages/react-native-web\",\n    \"packages/*\"\n  ],\n  \"husky\": {\n    \"hooks\": {\n      \"pre-commit\": \"lint-staged\"\n    }\n  },\n  \"lint-staged\": {\n    \"packages/react-native-web/src/index.js\": [\n      \"node ./scripts/createBabelReactNativeWebModuleMap.js\",\n      \"prettier --write ./packages/babel-plugin-react-native-web/src/moduleMap.js\"\n    ],\n    \"**/*.js\": [\n      \"npm run format:fix\",\n      \"npm run lint:fix\"\n    ]\n  },\n  \"prettier\": {\n    \"singleQuote\": true,\n    \"trailingComma\": \"none\"\n  },\n  \"author\": \"Nicolas Gallagher\",\n  \"license\": \"MIT\"\n}\n"
  },
  {
    "path": "packages/babel-plugin-react-native-web/LICENSE",
    "content": "MIT License\n\nCopyright (c) Nicolas Gallagher.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "packages/babel-plugin-react-native-web/README.md",
    "content": "# babel-plugin-react-native-web\n\n[![npm version][package-badge]][package-url] [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://reactjs.org/docs/how-to-contribute.html#your-first-pull-request)\n\nA Babel plugin that will alias `react-native` to `react-native-web` and exclude\nany modules not required by your app (keeping bundle size down).\n\n## Installation\n\n```\nnpm install --save-dev babel-plugin-react-native-web\n```\n\n## Usage\n\n**.babelrc**\n\n```\n{\n  \"plugins\": [\n    [\"react-native-web\", { commonjs: true }]\n  ]\n}\n```\n\nYou should configure the plugin to match the module format used by your\nbundler. Most modern bundlers will use a package's ES modules by default (i.e.,\nif `package.json` has a `module` field). But if you need the plugin to rewrite\nimport paths to point to CommonJS modules, you must set the `commonjs` option\nto `true`.\n\n## Example\n\nNOTE: `react-native-web` internal paths are _not stable_ and you must not rely\non them. Always use the Babel plugin to optimize your build. What follows is an\nexample of the rewrite performed by the plugin.\n\n**Before**\n\n```js\nimport { StyleSheet, View } from 'react-native';\n```\n\n**After**\n\n```js\nimport StyleSheet from 'react-native-web/dist/exports/StyleSheet';\nimport View from 'react-native-web/dist/exports/View';\n```\n\n[package-badge]: https://img.shields.io/npm/v/babel-plugin-react-native-web.svg?style=flat\n[package-url]: https://www.npmjs.com/package/babel-plugin-react-native-web\n"
  },
  {
    "path": "packages/babel-plugin-react-native-web/index.js",
    "content": "module.exports = require('./src');\n"
  },
  {
    "path": "packages/babel-plugin-react-native-web/package.json",
    "content": "{\n  \"publishConfig\": {\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"name\": \"babel-plugin-react-native-web\",\n  \"version\": \"0.21.2\",\n  \"description\": \"Babel plugin for React Native for Web\",\n  \"main\": \"index.js\",\n  \"devDependencies\": {\n    \"babel-plugin-tester\": \"^10.1.0\"\n  },\n  \"author\": \"Nicolas Gallagher\",\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/necolas/react-native-web.git\"\n  }\n}\n"
  },
  {
    "path": "packages/babel-plugin-react-native-web/src/__tests__/__snapshots__/index-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Rewrite react-native to react-native-web export from \"react-native\": export from \"react-native\" 1`] = `\n\nexport { View } from 'react-native';\nexport { StyleSheet, Text, unstable_createElement } from 'react-native';\n\n      ↓ ↓ ↓ ↓ ↓ ↓\n\nexport { default as View } from 'react-native-web/dist/exports/View';\nexport { default as StyleSheet } from 'react-native-web/dist/exports/StyleSheet';\nexport { default as Text } from 'react-native-web/dist/exports/Text';\nexport { default as unstable_createElement } from 'react-native-web/dist/exports/createElement';\n\n\n`;\n\nexports[`Rewrite react-native to react-native-web export from \"react-native-web\": export from \"react-native-web\" 1`] = `\n\nexport { View } from 'react-native-web';\nexport { StyleSheet, Text, unstable_createElement } from 'react-native-web';\n\n      ↓ ↓ ↓ ↓ ↓ ↓\n\nexport { default as View } from 'react-native-web/dist/exports/View';\nexport { default as StyleSheet } from 'react-native-web/dist/exports/StyleSheet';\nexport { default as Text } from 'react-native-web/dist/exports/Text';\nexport { default as unstable_createElement } from 'react-native-web/dist/exports/createElement';\n\n\n`;\n\nexports[`Rewrite react-native to react-native-web import from \"react-native\": import from \"react-native\" 1`] = `\n\nimport ReactNative from 'react-native';\nimport { View } from 'react-native';\nimport { Invalid, View as MyView } from 'react-native';\nimport { useLocaleContext } from 'react-native';\nimport * as ReactNativeModules from 'react-native';\n\n      ↓ ↓ ↓ ↓ ↓ ↓\n\nimport ReactNative from 'react-native-web/dist/index';\nimport View from 'react-native-web/dist/exports/View';\nimport { Invalid } from 'react-native-web/dist/index';\nimport MyView from 'react-native-web/dist/exports/View';\nimport useLocaleContext from 'react-native-web/dist/exports/useLocaleContext';\nimport * as ReactNativeModules from 'react-native-web/dist/index';\n\n\n`;\n\nexports[`Rewrite react-native to react-native-web import from \"react-native\": import from \"react-native\" 2`] = `\n\nimport ReactNative from 'react-native';\nimport { View } from 'react-native';\nimport { Invalid, View as MyView } from 'react-native';\nimport * as ReactNativeModules from 'react-native';\n\n      ↓ ↓ ↓ ↓ ↓ ↓\n\nimport ReactNative from 'react-native-web/dist/cjs/index';\nimport View from 'react-native-web/dist/cjs/exports/View';\nimport { Invalid } from 'react-native-web/dist/cjs/index';\nimport MyView from 'react-native-web/dist/cjs/exports/View';\nimport * as ReactNativeModules from 'react-native-web/dist/cjs/index';\n\n\n`;\n\nexports[`Rewrite react-native to react-native-web import from \"react-native-web\": import from \"react-native-web\" 1`] = `\n\nimport { unstable_createElement } from 'react-native-web';\nimport { StyleSheet, View, Pressable, processColor } from 'react-native-web';\nimport * as ReactNativeModules from 'react-native-web';\n\n      ↓ ↓ ↓ ↓ ↓ ↓\n\nimport unstable_createElement from 'react-native-web/dist/exports/createElement';\nimport StyleSheet from 'react-native-web/dist/exports/StyleSheet';\nimport View from 'react-native-web/dist/exports/View';\nimport Pressable from 'react-native-web/dist/exports/Pressable';\nimport processColor from 'react-native-web/dist/exports/processColor';\nimport * as ReactNativeModules from 'react-native-web/dist/index';\n\n\n`;\n\nexports[`Rewrite react-native to react-native-web require \"react-native\": require \"react-native\" 1`] = `\n\nconst ReactNative = require('react-native');\nconst { View } = require('react-native');\nconst { StyleSheet, Pressable } = require('react-native');\n\n      ↓ ↓ ↓ ↓ ↓ ↓\n\nconst ReactNative = require('react-native-web/dist/index');\nconst View = require('react-native-web/dist/exports/View').default;\nconst StyleSheet = require('react-native-web/dist/exports/StyleSheet').default;\nconst Pressable = require('react-native-web/dist/exports/Pressable').default;\n\n\n`;\n\nexports[`Rewrite react-native to react-native-web require \"react-native\": require \"react-native\" 2`] = `\n\nconst ReactNative = require('react-native');\nconst { View } = require('react-native');\nconst { StyleSheet, Pressable } = require('react-native');\n\n      ↓ ↓ ↓ ↓ ↓ ↓\n\nconst ReactNative = require('react-native-web/dist/cjs/index');\nconst View = require('react-native-web/dist/cjs/exports/View').default;\nconst StyleSheet =\n  require('react-native-web/dist/cjs/exports/StyleSheet').default;\nconst Pressable =\n  require('react-native-web/dist/cjs/exports/Pressable').default;\n\n\n`;\n\nexports[`Rewrite react-native to react-native-web require \"react-native-web\": require \"react-native-web\" 1`] = `\n\nconst ReactNative = require('react-native-web');\nconst { unstable_createElement } = require('react-native-web');\nconst { StyleSheet, View, Pressable, processColor } = require('react-native-web');\n\n      ↓ ↓ ↓ ↓ ↓ ↓\n\nconst ReactNative = require('react-native-web/dist/index');\nconst unstable_createElement =\n  require('react-native-web/dist/exports/createElement').default;\nconst StyleSheet = require('react-native-web/dist/exports/StyleSheet').default;\nconst View = require('react-native-web/dist/exports/View').default;\nconst Pressable = require('react-native-web/dist/exports/Pressable').default;\nconst processColor =\n  require('react-native-web/dist/exports/processColor').default;\n\n\n`;\n"
  },
  {
    "path": "packages/babel-plugin-react-native-web/src/__tests__/index-test.js",
    "content": "const plugin = require('..');\nconst pluginTester = require('babel-plugin-tester').default;\n\nconst tests = [\n  // import react-native\n  {\n    title: 'import from \"react-native\"',\n    code: `import ReactNative from 'react-native';\nimport { View } from 'react-native';\nimport { Invalid, View as MyView } from 'react-native';\nimport { useLocaleContext } from 'react-native';\nimport * as ReactNativeModules from 'react-native';`,\n    snapshot: true\n  },\n  {\n    title: 'import from \"react-native\"',\n    code: `import ReactNative from 'react-native';\nimport { View } from 'react-native';\nimport { Invalid, View as MyView } from 'react-native';\nimport * as ReactNativeModules from 'react-native';`,\n    snapshot: true,\n    pluginOptions: { commonjs: true }\n  },\n  {\n    title: 'import from \"react-native-web\"',\n    code: `import { unstable_createElement } from 'react-native-web';\nimport { StyleSheet, View, Pressable, processColor } from 'react-native-web';\nimport * as ReactNativeModules from 'react-native-web';`,\n    snapshot: true\n  },\n  {\n    title: 'export from \"react-native\"',\n    code: `export { View } from 'react-native';\nexport { StyleSheet, Text, unstable_createElement } from 'react-native';`,\n    snapshot: true\n  },\n  {\n    title: 'export from \"react-native-web\"',\n    code: `export { View } from 'react-native-web';\nexport { StyleSheet, Text, unstable_createElement } from 'react-native-web';`,\n    snapshot: true\n  },\n  // require react-native\n  {\n    title: 'require \"react-native\"',\n    code: `const ReactNative = require('react-native');\nconst { View } = require('react-native');\nconst { StyleSheet, Pressable } = require('react-native');`,\n    snapshot: true\n  },\n  {\n    title: 'require \"react-native\"',\n    code: `const ReactNative = require('react-native');\nconst { View } = require('react-native');\nconst { StyleSheet, Pressable } = require('react-native');`,\n    snapshot: true,\n    pluginOptions: { commonjs: true }\n  },\n  {\n    title: 'require \"react-native-web\"',\n    code: `const ReactNative = require('react-native-web');\nconst { unstable_createElement } = require('react-native-web');\nconst { StyleSheet, View, Pressable, processColor } = require('react-native-web');`,\n    snapshot: true\n  }\n];\n\npluginTester({\n  babelOptions: {\n    generatorOpts: {\n      jsescOption: {\n        quotes: 'single'\n      }\n    }\n  },\n  plugin,\n  pluginName: 'Rewrite react-native to react-native-web',\n  tests\n});\n"
  },
  {
    "path": "packages/babel-plugin-react-native-web/src/index.js",
    "content": "const moduleMap = require('./moduleMap');\n\nconst isCommonJS = (opts) => opts.commonjs === true;\n\nconst getDistLocation = (importName, opts) => {\n  const format = isCommonJS(opts) ? 'cjs/' : '';\n  const internalName =\n    importName === 'unstable_createElement' ? 'createElement' : importName;\n  if (internalName === 'index') {\n    return `react-native-web/dist/${format}index`;\n  } else if (internalName && moduleMap[internalName]) {\n    return `react-native-web/dist/${format}exports/${internalName}`;\n  }\n};\n\nconst isReactNativeRequire = (t, node) => {\n  const { declarations } = node;\n  if (declarations.length > 1) {\n    return false;\n  }\n  const { id, init } = declarations[0];\n  return (\n    (t.isObjectPattern(id) || t.isIdentifier(id)) &&\n    t.isCallExpression(init) &&\n    t.isIdentifier(init.callee) &&\n    init.callee.name === 'require' &&\n    init.arguments.length === 1 &&\n    (init.arguments[0].value === 'react-native' ||\n      init.arguments[0].value === 'react-native-web')\n  );\n};\n\nconst isReactNativeModule = ({ source, specifiers }) =>\n  source &&\n  (source.value === 'react-native' || source.value === 'react-native-web') &&\n  specifiers.length;\n\nmodule.exports = function ({ types: t }) {\n  return {\n    name: 'Rewrite react-native to react-native-web',\n    visitor: {\n      ImportDeclaration(path, state) {\n        const { specifiers } = path.node;\n        if (isReactNativeModule(path.node)) {\n          const imports = specifiers\n            .map((specifier) => {\n              if (t.isImportSpecifier(specifier)) {\n                const importName = specifier.imported.name;\n                const distLocation = getDistLocation(importName, state.opts);\n\n                if (distLocation) {\n                  return t.importDeclaration(\n                    [\n                      t.importDefaultSpecifier(\n                        t.identifier(specifier.local.name)\n                      )\n                    ],\n                    t.stringLiteral(distLocation)\n                  );\n                }\n              }\n              return t.importDeclaration(\n                [specifier],\n                t.stringLiteral(getDistLocation('index', state.opts))\n              );\n            })\n            .filter(Boolean);\n\n          path.replaceWithMultiple(imports);\n        }\n      },\n      ExportNamedDeclaration(path, state) {\n        const { specifiers } = path.node;\n        if (isReactNativeModule(path.node)) {\n          const exports = specifiers\n            .map((specifier) => {\n              if (t.isExportSpecifier(specifier)) {\n                const exportName = specifier.exported.name;\n                const localName = specifier.local.name;\n                const distLocation = getDistLocation(localName, state.opts);\n\n                if (distLocation) {\n                  return t.exportNamedDeclaration(\n                    null,\n                    [\n                      t.exportSpecifier(\n                        t.identifier('default'),\n                        t.identifier(exportName)\n                      )\n                    ],\n                    t.stringLiteral(distLocation)\n                  );\n                }\n              }\n              return t.exportNamedDeclaration(\n                null,\n                [specifier],\n                t.stringLiteral(getDistLocation('index', state.opts))\n              );\n            })\n            .filter(Boolean);\n\n          path.replaceWithMultiple(exports);\n        }\n      },\n      VariableDeclaration(path, state) {\n        if (isReactNativeRequire(t, path.node)) {\n          const { id } = path.node.declarations[0];\n          if (t.isObjectPattern(id)) {\n            const imports = id.properties\n              .map((identifier) => {\n                const distLocation = getDistLocation(\n                  identifier.key.name,\n                  state.opts\n                );\n                if (distLocation) {\n                  return t.variableDeclaration(path.node.kind, [\n                    t.variableDeclarator(\n                      t.identifier(identifier.value.name),\n                      t.memberExpression(\n                        t.callExpression(t.identifier('require'), [\n                          t.stringLiteral(distLocation)\n                        ]),\n                        t.identifier('default')\n                      )\n                    )\n                  ]);\n                }\n              })\n              .filter(Boolean);\n\n            path.replaceWithMultiple(imports);\n          } else if (t.isIdentifier(id)) {\n            const name = id.name;\n            const importIndex = t.variableDeclaration(path.node.kind, [\n              t.variableDeclarator(\n                t.identifier(name),\n                t.callExpression(t.identifier('require'), [\n                  t.stringLiteral(getDistLocation('index', state.opts))\n                ])\n              )\n            ]);\n\n            path.replaceWith(importIndex);\n          }\n        }\n      }\n    }\n  };\n};\n"
  },
  {
    "path": "packages/babel-plugin-react-native-web/src/moduleMap.js",
    "content": "// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.\nmodule.exports = {\n  AccessibilityInfo: true,\n  ActivityIndicator: true,\n  Alert: true,\n  Animated: true,\n  AppRegistry: true,\n  AppState: true,\n  Appearance: true,\n  BackHandler: true,\n  Button: true,\n  CheckBox: true,\n  Clipboard: true,\n  DeviceEventEmitter: true,\n  Dimensions: true,\n  Easing: true,\n  FlatList: true,\n  I18nManager: true,\n  Image: true,\n  ImageBackground: true,\n  InputAccessoryView: true,\n  InteractionManager: true,\n  Keyboard: true,\n  KeyboardAvoidingView: true,\n  LayoutAnimation: true,\n  Linking: true,\n  LogBox: true,\n  Modal: true,\n  NativeEventEmitter: true,\n  NativeModules: true,\n  PanResponder: true,\n  Picker: true,\n  PixelRatio: true,\n  Platform: true,\n  Pressable: true,\n  ProgressBar: true,\n  RefreshControl: true,\n  SafeAreaView: true,\n  ScrollView: true,\n  SectionList: true,\n  Share: true,\n  StatusBar: true,\n  StyleSheet: true,\n  Switch: true,\n  Text: true,\n  TextInput: true,\n  Touchable: true,\n  TouchableHighlight: true,\n  TouchableNativeFeedback: true,\n  TouchableOpacity: true,\n  TouchableWithoutFeedback: true,\n  UIManager: true,\n  Vibration: true,\n  View: true,\n  VirtualizedList: true,\n  YellowBox: true,\n  createElement: true,\n  findNodeHandle: true,\n  processColor: true,\n  render: true,\n  unmountComponentAtNode: true,\n  useColorScheme: true,\n  useLocaleContext: true,\n  useWindowDimensions: true\n};\n"
  },
  {
    "path": "packages/benchmarks/LICENSE",
    "content": "MIT License\n\nCopyright (c) Nicolas Gallagher.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "packages/benchmarks/README.md",
    "content": "# Benchmarks\n\nTry the [benchmarks app](https://necolas.github.io/react-native-web/benchmarks) online.\n\nTo work on the benchmarks locally from monorepo root:\n\n```\nnpm run dev -w react-native-web\nnpm run build -w benchmarks\nopen ./packages/benchmarks/dist/index.html\n```\n\n## Notes\n\nThese benchmarks are approximations of extreme cases that libraries may\nencounter. Their purpose is to provide an early-warning signal for performance\nregressions. Each test report includes the mean and standard deviation of the\ntimings, and approximations of the time spent in scripting (S) and layout (L).\n\nThe components used in the render benchmarks are simple enough to be\nimplemented by multiple UI or style libraries. The benchmark implementations\nand the features of the style libraries are _only approximately equivalent in\nfunctionality_.\n\nNo benchmark will run for more than 20 seconds.\n\n### Mount deep/wide tree\n\nThese cases look at the performance of mounting and rendering large trees of\nelements that use static styles.\n\n### Update dynamic styles\n\nThis case looks at the performance of repeated style updates to a large mounted\ntree. Some libraries choose to inject new styles for each \"dynamic style\",\nwhereas others choose to use inline styles. Libraries without built-in support\nfor dynamic styles (i.e., they rely on user-authored inline styles) are not\nincluded.\n\n## Example results\n\n### MacBook Pro (2011)\n\nMacBook Pro (13-inch, Early 2011); 2.3 GHz Intel Core i5; 8 GB 1333 MHz DDR3 RAM. Google Chrome 72.\n\nTypical render timings: mean ± standard deviations.\n\n| Implementation                        | Mount deep tree (ms) | Mount wide tree (ms) | Dynamic update (ms) |\n| :--- | ---: | ---: | ---: |\n| `css-modules`                         |     `23.41` `±03.06` |     `35.38` `±06.41` |                   - |\n| `react-native-web@0.11.0`             |     `28.37` `±04.39` |     `41.50` `±05.75` |    `23.13` `±03.51` |\n| `inline-styles`                       |     `66.19` `±06.31` |    `104.22` `±10.22` |    `09.96` `±02.76` |\n\n### Moto G4\n\nMoto G4 (Android 7); Octa-core (4x1.5 GHz & 4x1.2 Ghz); 2 GB RAM. Google Chrome 72.\n\nTypical render timings: mean ± standard deviations.\n\n| Implementation                        | Mount deep tree (ms) | Mount wide tree (ms) | Dynamic update (ms) |\n| :--- | ---: | ---: | ---: |\n| `css-modules`                         |     `71.33` `±09.68` |    `101.36` `±12.36` |                   - |\n| `react-native-web@0.11.0`             |     `83.65` `±12.40` |    `123.59` `±14.40` |    `75.41` `±07.74` |\n| `inline-styles`                       |    `188.35` `±17.69` |    `282.35` `±22.48` |    `28.10` `±06.87` |\n"
  },
  {
    "path": "packages/benchmarks/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>Performance tests</title>\n  <meta name=\"viewport\" content=\"width=device-width\">\n  <style>\n    html, body { height: 100%; width: 100%; overflow: hidden; }\n    .root { height: 100%; overflow: hidden; }\n  </style>\n</head>\n<body>\n  <div class=\"root\"></div>\n  <script src=\"./bundle.js\"></script>\n</body>\n</html>\n"
  },
  {
    "path": "packages/benchmarks/package.json",
    "content": "{\n  \"private\": true,\n  \"name\": \"benchmarks\",\n  \"version\": \"0.0.0\",\n  \"scripts\": {\n    \"clean\": \"del-cli ./dist\",\n    \"build\": \"NODE_ENV=production npm run dev\",\n    \"dev\": \"npm run clean && mkdir -p dist && cp -f index.html dist/index.html && webpack --config ./webpack.config.js\"\n  },\n  \"dependencies\": {\n    \"classnames\": \"^2.3.1\",\n    \"d3-scale-chromatic\": \"^3.0.0\",\n    \"prop-types\": \"^15.6.0\",\n    \"react\": \"^19.0.0\",\n    \"react-dom\": \"^19.0.0\",\n    \"react-native-web\": \"0.18.10\"\n  },\n  \"devDependencies\": {\n    \"babel-loader\": \"^8.2.5\",\n    \"babel-plugin-react-native-web\": \"0.18.10\",\n    \"css-loader\": \"^6.7.1\",\n    \"style-loader\": \"^3.3.1\",\n    \"url-loader\": \"^4.1.1\",\n    \"webpack\": \"^5.76.0\",\n    \"webpack-bundle-analyzer\": \"^4.5.0\",\n    \"webpack-cli\": \"^4.10.0\"\n  }\n}\n"
  },
  {
    "path": "packages/benchmarks/src/app/App.js",
    "content": "import Benchmark from './Benchmark';\nimport { Picker, StyleSheet, ScrollView, Pressable, View } from 'react-native';\nimport React, { Component } from 'react';\nimport Button from './Button';\nimport { IconClear, IconEye } from './Icons';\nimport ReportCard from './ReportCard';\nimport Text from './Text';\nimport Layout from './Layout';\nimport { colors } from './theme';\n\nconst Overlay = () => <View style={[StyleSheet.absoluteFill, { zIndex: 2 }]} />;\n\nexport default class App extends Component {\n  static displayName = '@app/App';\n\n  constructor(props, context) {\n    super(props, context);\n    const currentBenchmarkName = Object.keys(props.tests)[0];\n    this.state = {\n      currentBenchmarkName,\n      currentLibraryName: 'react-native-web',\n      status: 'idle',\n      results: []\n    };\n  }\n\n  render() {\n    const { tests } = this.props;\n    const { currentBenchmarkName, status, currentLibraryName, results } =\n      this.state;\n    const currentImplementation =\n      tests[currentBenchmarkName][currentLibraryName];\n    const { Component, Provider, getComponentProps, sampleCount } =\n      currentImplementation;\n\n    return (\n      <Layout\n        actionPanel={\n          <View>\n            <View style={styles.pickers}>\n              <View style={styles.pickerContainer}>\n                <Text style={styles.pickerTitle}>Library</Text>\n                <Text style={{ fontWeight: 'bold' }}>{currentLibraryName}</Text>\n\n                <Picker\n                  enabled={status !== 'running'}\n                  onValueChange={this._handleChangeLibrary}\n                  selectedValue={currentLibraryName}\n                  style={styles.picker}\n                >\n                  {Object.keys(tests[currentBenchmarkName]).map(\n                    (libraryName) => (\n                      <Picker.Item\n                        key={libraryName}\n                        label={libraryName}\n                        value={libraryName}\n                      />\n                    )\n                  )}\n                </Picker>\n              </View>\n              <View style={{ width: 1, backgroundColor: colors.fadedGray }} />\n              <View style={styles.pickerContainer}>\n                <Text style={styles.pickerTitle}>Benchmark</Text>\n                <Text>{currentBenchmarkName}</Text>\n                <Picker\n                  enabled={status !== 'running'}\n                  onValueChange={this._handleChangeBenchmark}\n                  selectedValue={currentBenchmarkName}\n                  style={styles.picker}\n                >\n                  {Object.keys(tests).map((test) => (\n                    <Picker.Item key={test} label={test} value={test} />\n                  ))}\n                </Picker>\n              </View>\n            </View>\n\n            <View style={{ flexDirection: 'row', height: 50 }}>\n              <View style={styles.grow}>\n                <Button\n                  onPress={this._handleStart}\n                  style={styles.button}\n                  title={status === 'running' ? 'Running…' : 'Run'}\n                />\n              </View>\n            </View>\n\n            {status === 'running' ? <Overlay /> : null}\n          </View>\n        }\n        listPanel={\n          <View style={styles.listPanel}>\n            <View style={styles.grow}>\n              <View style={styles.listBar}>\n                <View style={styles.iconClearContainer}>\n                  <Pressable onPress={this._handleClear}>\n                    <IconClear />\n                  </Pressable>\n                </View>\n              </View>\n              <ScrollView ref={this._setScrollRef} style={styles.grow}>\n                {results.map((r, i) => (\n                  <ReportCard\n                    benchmarkName={r.benchmarkName}\n                    key={i}\n                    libraryName={r.libraryName}\n                    libraryVersion={r.libraryVersion}\n                    mean={r.mean}\n                    meanLayout={r.meanLayout}\n                    meanScripting={r.meanScripting}\n                    runTime={r.runTime}\n                    sampleCount={r.sampleCount}\n                    stdDev={r.stdDev}\n                  />\n                ))}\n                {status === 'running' ? (\n                  <ReportCard\n                    benchmarkName={currentBenchmarkName}\n                    libraryName={currentLibraryName}\n                  />\n                ) : null}\n              </ScrollView>\n            </View>\n            {status === 'running' ? <Overlay /> : null}\n          </View>\n        }\n        viewPanel={\n          <View style={styles.viewPanel}>\n            <View style={styles.iconEyeContainer}>\n              <Pressable onPress={this._handleVisuallyHideBenchmark}>\n                <IconEye style={styles.iconEye} />\n              </Pressable>\n            </View>\n\n            <Provider>\n              {status === 'running' ? (\n                <React.Fragment>\n                  <View ref={this._setBenchWrapperRef}>\n                    <Benchmark\n                      component={Component}\n                      forceLayout={true}\n                      getComponentProps={getComponentProps}\n                      onComplete={this._createHandleComplete({\n                        sampleCount,\n                        benchmarkName: currentBenchmarkName,\n                        libraryName: currentLibraryName\n                      })}\n                      ref={this._setBenchRef}\n                      sampleCount={sampleCount}\n                      timeout={20000}\n                      type={Component.benchmarkType}\n                    />\n                  </View>\n                </React.Fragment>\n              ) : (\n                <Component {...getComponentProps({ cycle: 10 })} />\n              )}\n            </Provider>\n\n            {status === 'running' ? <Overlay /> : null}\n          </View>\n        }\n      />\n    );\n  }\n\n  _handleChangeBenchmark = (value) => {\n    this.setState(() => ({ currentBenchmarkName: value }));\n  };\n\n  _handleChangeLibrary = (value) => {\n    this.setState(() => ({ currentLibraryName: value }));\n  };\n\n  _handleStart = () => {\n    this.setState(\n      () => ({ status: 'running' }),\n      () => {\n        if (this._shouldHideBenchmark && this._benchWrapperRef) {\n          this._benchWrapperRef.style.opacity = 0;\n        }\n        this._benchmarkRef.start();\n        this._scrollToEnd();\n      }\n    );\n  };\n\n  // hide the benchmark as it is performed (no flashing on screen)\n  _handleVisuallyHideBenchmark = () => {\n    this._shouldHideBenchmark = !this._shouldHideBenchmark;\n    if (this._benchWrapperRef) {\n      this._benchWrapperRef.style.opacity = this._shouldHideBenchmark ? 0 : 1;\n    }\n  };\n\n  _createHandleComplete =\n    ({ benchmarkName, libraryName, sampleCount }) =>\n    (results) => {\n      this.setState(\n        (state) => ({\n          results: state.results.concat([\n            {\n              ...results,\n              benchmarkName,\n              libraryName,\n              libraryVersion:\n                this.props.tests[benchmarkName][libraryName].version\n            }\n          ]),\n          status: 'complete'\n        }),\n        this._scrollToEnd\n      );\n      // console.log(results);\n      // console.log(results.samples.map(sample => sample.elapsed.toFixed(1)).join('\\n'));\n    };\n\n  _handleClear = () => {\n    this.setState(() => ({ results: [] }));\n  };\n\n  _setBenchRef = (ref) => {\n    this._benchmarkRef = ref;\n  };\n\n  _setBenchWrapperRef = (ref) => {\n    this._benchWrapperRef = ref;\n  };\n\n  _setScrollRef = (ref) => {\n    this._scrollRef = ref;\n  };\n\n  // scroll the most recent result into view\n  _scrollToEnd = () => {\n    window.requestAnimationFrame(() => {\n      if (this._scrollRef) {\n        this._scrollRef.scrollToEnd();\n      }\n    });\n  };\n}\n\nconst styles = StyleSheet.create({\n  viewPanel: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center',\n    overflow: 'hidden',\n    backgroundColor: 'black'\n  },\n  iconEye: {\n    color: 'white',\n    height: 32\n  },\n  iconEyeContainer: {\n    position: 'absolute',\n    top: 10,\n    right: 10,\n    zIndex: 1\n  },\n  iconClearContainer: {\n    height: '100%',\n    marginLeft: 5\n  },\n  grow: {\n    flex: 1\n  },\n  listPanel: {\n    flex: 1,\n    width: '100%',\n    marginHorizontal: 'auto'\n  },\n  listBar: {\n    padding: 5,\n    alignItems: 'center',\n    flexDirection: 'row',\n    backgroundColor: colors.fadedGray,\n    borderBottomWidth: 1,\n    borderBottomColor: colors.mediumGray,\n    justifyContent: 'flex-end'\n  },\n  pickers: {\n    flexDirection: 'row'\n  },\n  pickerContainer: {\n    flex: 1,\n    padding: 5\n  },\n  pickerTitle: {\n    fontSize: 12,\n    color: colors.deepGray\n  },\n  picker: {\n    ...StyleSheet.absoluteFillObject,\n    appearance: 'none',\n    opacity: 0,\n    width: '100%'\n  },\n  button: {\n    borderRadius: 0,\n    flex: 1\n  }\n});\n"
  },
  {
    "path": "packages/benchmarks/src/app/Benchmark/index.js",
    "content": "/**\n * The MIT License (MIT)\n * Copyright (c) 2017 Paul Armstrong\n * https://github.com/paularmstrong/react-component-benchmark\n * @flow\n */\n\n/* global $Values */\n\nimport type { Node } from 'react';\n\nimport * as Timing from './timing';\nimport React, { Component } from 'react';\nimport { getMean, getMedian, getStdDev } from './math';\n\nimport type {\n  BenchResultsType,\n  FullSampleTimingType,\n  SampleTimingType\n} from './types';\n\nexport const BenchmarkType = {\n  MOUNT: 'mount',\n  UPDATE: 'update',\n  UNMOUNT: 'unmount'\n};\n\nconst shouldRender = (\n  cycle: number,\n  type: $Values<typeof BenchmarkType>\n): boolean => {\n  switch (type) {\n    // Render every odd iteration (first, third, etc)\n    // Mounts and unmounts the component\n    case BenchmarkType.MOUNT:\n    case BenchmarkType.UNMOUNT:\n      return !((cycle + 1) % 2);\n    // Render every iteration (updates previously rendered module)\n    case BenchmarkType.UPDATE:\n      return true;\n    default:\n      return false;\n  }\n};\n\nconst shouldRecord = (\n  cycle: number,\n  type: $Values<typeof BenchmarkType>\n): boolean => {\n  switch (type) {\n    // Record every odd iteration (when mounted: first, third, etc)\n    case BenchmarkType.MOUNT:\n      return !((cycle + 1) % 2);\n    // Record every iteration\n    case BenchmarkType.UPDATE:\n      return true;\n    // Record every even iteration (when unmounted)\n    case BenchmarkType.UNMOUNT:\n      return !(cycle % 2);\n    default:\n      return false;\n  }\n};\n\nconst isDone = (\n  cycle: number,\n  sampleCount: number,\n  type: $Values<typeof BenchmarkType>\n): boolean => {\n  switch (type) {\n    case BenchmarkType.MOUNT:\n      return cycle >= sampleCount * 2 - 1;\n    case BenchmarkType.UPDATE:\n      return cycle >= sampleCount - 1;\n    case BenchmarkType.UNMOUNT:\n      return cycle >= sampleCount * 2;\n    default:\n      return true;\n  }\n};\n\nconst sortNumbers = (a: number, b: number): number => a - b;\n\ntype BenchmarkPropsType = {\n  component: typeof React.Component,\n  forceLayout?: boolean,\n  getComponentProps: Function,\n  onComplete: (x: BenchResultsType) => void,\n  sampleCount: number,\n  timeout: number,\n  type: $Values<typeof BenchmarkType>\n};\n\ntype BenchmarkStateType = {\n  componentProps: Object,\n  cycle: number,\n  running: boolean\n};\n\n/**\n * Benchmark\n * TODO: documentation\n */\nexport default class Benchmark extends Component<\n  BenchmarkPropsType,\n  BenchmarkStateType\n> {\n  _raf: ?Function;\n  _startTime: number;\n  _samples: Array<SampleTimingType>;\n\n  static displayName: ?string = 'Benchmark';\n\n  static defaultProps: {|\n    sampleCount: number,\n    timeout: number,\n    type: $PropertyType<BenchmarkPropsType, 'type'>\n  |} = {\n    sampleCount: 50,\n    timeout: 10000, // 10 seconds\n    type: BenchmarkType.MOUNT\n  };\n\n  static Type: typeof BenchmarkType = BenchmarkType;\n\n  constructor(props: BenchmarkPropsType, context?: {}) {\n    super(props, context);\n    const cycle = 0;\n    const componentProps = props.getComponentProps({ cycle });\n    this.state = {\n      componentProps,\n      cycle,\n      running: false\n    };\n    this._startTime = 0;\n    this._samples = [];\n  }\n\n  componentWillReceiveProps(nextProps: BenchmarkPropsType) {\n    if (nextProps) {\n      this.setState((state) => ({\n        componentProps: nextProps.getComponentProps(state.cycle)\n      }));\n    }\n  }\n\n  componentWillUpdate(\n    nextProps: BenchmarkPropsType,\n    nextState: BenchmarkStateType\n  ) {\n    if (nextState.running && !this.state.running) {\n      this._startTime = Timing.now();\n    }\n  }\n\n  componentDidUpdate() {\n    const { forceLayout, sampleCount, timeout, type } = this.props;\n    const { cycle, running } = this.state;\n\n    if (running && shouldRecord(cycle, type)) {\n      this._samples[cycle].scriptingEnd = Timing.now();\n\n      // force style recalc that would otherwise happen before the next frame\n      if (forceLayout) {\n        this._samples[cycle].layoutStart = Timing.now();\n        if (document.body) {\n          document.body.offsetWidth;\n        }\n        this._samples[cycle].layoutEnd = Timing.now();\n      }\n    }\n\n    if (running) {\n      const now = Timing.now();\n      if (\n        !isDone(cycle, sampleCount, type) &&\n        now - this._startTime < timeout\n      ) {\n        this._handleCycleComplete();\n      } else {\n        this._handleComplete(now);\n      }\n    }\n  }\n\n  componentWillUnmount() {\n    if (this._raf) {\n      window.cancelAnimationFrame(this._raf);\n    }\n  }\n\n  render(): Node {\n    const { component: Component, type } = this.props;\n    const { componentProps, cycle, running } = this.state;\n    if (running && shouldRecord(cycle, type)) {\n      this._samples[cycle] = { scriptingStart: Timing.now() };\n    }\n    return running && shouldRender(cycle, type) ? (\n      <Component {...componentProps} />\n    ) : null;\n  }\n\n  start() {\n    this._samples = [];\n    this.setState(() => ({ running: true, cycle: 0 }));\n  }\n\n  _handleCycleComplete() {\n    const { getComponentProps, type } = this.props;\n    const { cycle } = this.state;\n\n    let componentProps;\n    if (getComponentProps) {\n      // Calculate the component props outside of the time recording (render)\n      // so that it doesn't skew results\n      componentProps = getComponentProps({ cycle });\n      // make sure props always change for update tests\n      if (type === BenchmarkType.UPDATE) {\n        componentProps['data-test'] = cycle;\n      }\n    }\n\n    this._raf = window.requestAnimationFrame(() => {\n      this.setState((state: BenchmarkStateType) => ({\n        cycle: state.cycle + 1,\n        componentProps\n      }));\n    });\n  }\n\n  getSamples(): Array<FullSampleTimingType> {\n    return this._samples.reduce(\n      (\n        memo: Array<FullSampleTimingType>,\n        {\n          scriptingStart,\n          scriptingEnd,\n          layoutStart,\n          layoutEnd\n        }: SampleTimingType\n      ): Array<FullSampleTimingType> => {\n        memo.push({\n          start: scriptingStart,\n          end: layoutEnd || scriptingEnd || 0,\n          scriptingStart,\n          scriptingEnd: scriptingEnd || 0,\n          layoutStart,\n          layoutEnd\n        });\n        return memo;\n      },\n      []\n    );\n  }\n\n  _handleComplete(endTime: number) {\n    const { onComplete } = this.props;\n    const samples = this.getSamples();\n\n    this.setState(() => ({ running: false, cycle: 0 }));\n\n    const runTime = endTime - this._startTime;\n    const sortedElapsedTimes = samples\n      .map(({ start, end }) => end - start)\n      .sort(sortNumbers);\n    const sortedScriptingElapsedTimes = samples\n      .map(({ scriptingStart, scriptingEnd }) => scriptingEnd - scriptingStart)\n      .sort(sortNumbers);\n    const sortedLayoutElapsedTimes = samples\n      .map(\n        ({ layoutStart, layoutEnd }) => (layoutEnd || 0) - (layoutStart || 0)\n      )\n      .sort(sortNumbers);\n\n    onComplete({\n      startTime: this._startTime,\n      endTime,\n      runTime,\n      sampleCount: samples.length,\n      samples: samples,\n      max: sortedElapsedTimes[sortedElapsedTimes.length - 1],\n      min: sortedElapsedTimes[0],\n      median: getMedian(sortedElapsedTimes),\n      mean: getMean(sortedElapsedTimes),\n      stdDev: getStdDev(sortedElapsedTimes),\n      meanLayout: getMean(sortedLayoutElapsedTimes),\n      meanScripting: getMean(sortedScriptingElapsedTimes)\n    });\n  }\n}\n"
  },
  {
    "path": "packages/benchmarks/src/app/Benchmark/math.js",
    "content": "// @flow\ntype ValuesType = Array<number>;\n\nexport const getStdDev = (values: ValuesType): number => {\n  const avg = getMean(values);\n\n  const squareDiffs = values.map((value: number) => {\n    const diff = value - avg;\n    return diff * diff;\n  });\n\n  return Math.sqrt(getMean(squareDiffs));\n};\n\nexport const getMean = (values: ValuesType): number => {\n  const sum = values.reduce((sum: number, value: number) => sum + value, 0);\n  return sum / values.length;\n};\n\nexport const getMedian = (values: ValuesType): number => {\n  if (values.length === 1) {\n    return values[0];\n  }\n\n  const numbers = values.sort((a: number, b: number) => a - b);\n  return (\n    (numbers[(numbers.length - 1) >> 1] + numbers[numbers.length >> 1]) / 2\n  );\n};\n"
  },
  {
    "path": "packages/benchmarks/src/app/Benchmark/timing.js",
    "content": "// @flow\n\n// Returns a high resolution time (if possible) in milliseconds\nexport function now(): number {\n  if (window && window.performance) {\n    return window.performance.now();\n  } else {\n    return Date.now();\n  }\n}\n"
  },
  {
    "path": "packages/benchmarks/src/app/Benchmark/types.js",
    "content": "/**\n * @flow\n */\nexport type BenchResultsType = {\n  startTime: number,\n  endTime: number,\n  runTime: number,\n  sampleCount: number,\n  samples: Array<FullSampleTimingType>,\n  max: number,\n  min: number,\n  median: number,\n  mean: number,\n  stdDev: number\n};\n\nexport type SampleTimingType = {\n  scriptingStart: number,\n  scriptingEnd?: number,\n  layoutStart?: number,\n  layoutEnd?: number\n};\n\nexport type FullSampleTimingType = {\n  start: number,\n  end: number,\n  scriptingStart: number,\n  scriptingEnd: number,\n  layoutStart?: number,\n  layoutEnd?: number\n};\n"
  },
  {
    "path": "packages/benchmarks/src/app/Button.js",
    "content": "import { StyleSheet, TouchableHighlight, Text } from 'react-native';\nimport React, { Component } from 'react';\n\nexport default class Button extends Component<*> {\n  static displayName = '@app/Button';\n\n  render() {\n    const {\n      accessibilityLabel,\n      color,\n      disabled,\n      onPress,\n      style,\n      textStyle,\n      testID,\n      title\n    } = this.props;\n\n    return (\n      <TouchableHighlight\n        accessibilityLabel={accessibilityLabel}\n        accessibilityRole=\"button\"\n        disabled={disabled}\n        onPress={onPress}\n        style={[\n          styles.button,\n          style,\n          color && { backgroundColor: color },\n          disabled && styles.buttonDisabled\n        ]}\n        testID={testID}\n      >\n        <Text style={[styles.text, textStyle, disabled && styles.textDisabled]}>\n          {title}\n        </Text>\n      </TouchableHighlight>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  button: {\n    backgroundColor: '#2196F3',\n    borderRadius: 0,\n    justifyContent: 'center'\n  },\n  text: {\n    color: '#fff',\n    fontSize: 20,\n    fontWeight: '500',\n    padding: 8,\n    textAlign: 'center',\n    textTransform: 'uppercase'\n  },\n  buttonDisabled: {\n    backgroundColor: '#dfdfdf'\n  },\n  textDisabled: {\n    color: '#a1a1a1'\n  }\n});\n"
  },
  {
    "path": "packages/benchmarks/src/app/Icons.js",
    "content": "import React, { Fragment } from 'react';\nimport {\n  unstable_createElement as createElement,\n  StyleSheet\n} from 'react-native';\n\nconst styles = StyleSheet.create({\n  root: {\n    display: 'inline-block',\n    fill: 'currentcolor',\n    height: '1.25em',\n    maxWidth: '100%',\n    position: 'relative',\n    userSelect: 'none',\n    textAlignVertical: 'text-bottom'\n  }\n});\n\nconst createIcon = (children) => {\n  const Icon = (props) =>\n    createElement('svg', {\n      children,\n      style: [styles.root, props.style],\n      width: 24,\n      height: 24,\n      viewBox: '0 0 24 24'\n    });\n  return Icon;\n};\n\nexport const IconClear = createIcon(\n  <Fragment>\n    <path d=\"M0 0h24v24H0z\" id=\"bounds\" opacity=\"0\" />\n    <path d=\"M12 1.25C6.072 1.25 1.25 6.072 1.25 12S6.072 22.75 12 22.75 22.75 17.928 22.75 12 17.928 1.25 12 1.25zm0 1.5c2.28 0 4.368.834 5.982 2.207L4.957 17.982C3.584 16.368 2.75 14.282 2.75 12c0-5.1 4.15-9.25 9.25-9.25zm0 18.5c-2.28 0-4.368-.834-5.982-2.207L19.043 6.018c1.373 1.614 2.207 3.7 2.207 5.982 0 5.1-4.15 9.25-9.25 9.25z\" />\n  </Fragment>\n);\n\nexport const IconEye = createIcon(\n  <Fragment>\n    <path d=\"M0 0h24v24H0z\" id=\"bounds\" opacity=\"0\" />\n    <path d=\"M14.548 11.634c-1.207 0-2.188-.98-2.188-2.188 0-.664.302-1.25.77-1.653-.363-.097-.736-.165-1.13-.165-2.416 0-4.375 1.96-4.375 4.376S9.585 16.38 12 16.38c2.418 0 4.377-1.96 4.377-4.376 0-.4-.07-.78-.17-1.146-.402.47-.992.776-1.66.776z\" />\n    <path d=\"M12 19.79c-7.228 0-10.12-6.724-10.24-7.01-.254-.466-.254-1.105.035-1.642C1.88 10.923 4.772 4.2 12 4.2s10.12 6.723 10.24 7.01c.254.465.254 1.104-.035 1.64-.085.216-2.977 6.94-10.205 6.94zm0-14c-6.154 0-8.668 5.787-8.772 6.033-.068.135-.068.208-.033.273.137.316 2.65 6.104 8.805 6.104 6.18 0 8.747-5.973 8.772-6.033.07-.136.07-.21.034-.274-.138-.316-2.652-6.103-8.806-6.103z\" />\n  </Fragment>\n);\n\nexport const IconCopy = createIcon(\n  <Fragment>\n    <path d=\"M0 0h24v24H0z\" id=\"bounds\" opacity=\"0\" />\n    <path d=\"M11.47 14.53c.146.146.338.22.53.22s.384-.073.53-.22l5-5c.293-.293.293-.768 0-1.06s-.768-.294-1.06 0l-3.72 3.72V2c0-.414-.337-.75-.75-.75s-.75.336-.75.75v10.19L7.53 8.47c-.293-.293-.768-.293-1.06 0s-.294.768 0 1.06l5 5z\" />\n    <path d=\"M21.25 13.25c-.414 0-.75.336-.75.75v5.652c0 .437-.355.792-.792.792H4.292c-.437 0-.792-.355-.792-.792V14c0-.414-.336-.75-.75-.75S2 13.586 2 14v5.652c0 1.264 1.028 2.292 2.292 2.292h15.416c1.264 0 2.292-1.028 2.292-2.292V14c0-.414-.336-.75-.75-.75z\" />\n  </Fragment>\n);\n"
  },
  {
    "path": "packages/benchmarks/src/app/Layout.js",
    "content": "import { colors } from './theme';\nimport React, { Component } from 'react';\nimport { StyleSheet, View } from 'react-native';\n\nexport default class Layout extends Component {\n  state = {\n    widescreen: false\n  };\n\n  render() {\n    const { viewPanel, actionPanel, listPanel } = this.props;\n    const { widescreen } = this.state;\n    return (\n      <View\n        onLayout={this._handleLayout}\n        style={[styles.root, widescreen && styles.row]}\n      >\n        <View\n          style={[widescreen ? styles.grow : styles.stackPanel, styles.layer]}\n        >\n          {viewPanel}\n        </View>\n        <View style={styles.grow}>\n          <View style={[styles.grow, styles.layer]}>{listPanel}</View>\n          <View style={styles.divider} />\n          <View style={styles.layer}>{actionPanel}</View>\n        </View>\n      </View>\n    );\n  }\n\n  _handleLayout = ({ nativeEvent }) => {\n    const { layout } = nativeEvent;\n    const { width } = layout;\n    if (width >= 740) {\n      this.setState(() => ({ widescreen: true }));\n    } else {\n      this.setState(() => ({ widescreen: false }));\n    }\n  };\n}\n\nconst styles = StyleSheet.create({\n  root: {\n    height: '100%'\n  },\n  row: {\n    flexDirection: 'row'\n  },\n  divider: {\n    height: 10,\n    backgroundColor: colors.fadedGray,\n    borderBottomWidth: 1,\n    borderTopWidth: 1,\n    borderColor: colors.mediumGray\n  },\n  grow: {\n    flex: 1\n  },\n  stackPanel: {\n    height: '33.33%'\n  },\n  layer: {\n    transform: [{ translateZ: '0' }]\n  }\n});\n"
  },
  {
    "path": "packages/benchmarks/src/app/ReportCard.js",
    "content": "/* @noflow */\n\nimport Text from './Text';\nimport { StyleSheet, View } from 'react-native';\nimport React, { Fragment } from 'react';\n\nconst fmt = (time: number) => {\n  const i = Number(Math.round(time + 'e2') + 'e-2').toFixed(2);\n  return 10 / i > 1 ? `0${i}` : i;\n};\n\nclass ReportCard extends React.PureComponent {\n  render() {\n    const {\n      benchmarkName,\n      libraryName,\n      sampleCount,\n      mean,\n      meanLayout,\n      meanScripting,\n      stdDev,\n      libraryVersion\n    } = this.props;\n\n    const sampleCountText = sampleCount != null ? `(${sampleCount})` : '';\n\n    return (\n      <View style={styles.root}>\n        <View style={styles.left}>\n          <Text numberOfLines={1} style={styles.bold}>\n            {`${libraryName}${libraryVersion ? '@' + libraryVersion : ''}`}\n          </Text>\n          <Text numberOfLines={1}>\n            {benchmarkName} {sampleCountText}\n          </Text>\n        </View>\n        <View style={styles.right}>\n          {mean ? (\n            <Fragment>\n              <Text style={[styles.bold, styles.monoFont]}>\n                {fmt(mean)} ±{fmt(stdDev)} ms\n              </Text>\n              <Text style={[styles.smallText, styles.monoFont]}>\n                (S/L) {fmt(meanScripting)}/{fmt(meanLayout)} ms\n              </Text>\n            </Fragment>\n          ) : (\n            <Text style={styles.bold}>In progress…</Text>\n          )}\n        </View>\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  root: {\n    flexDirection: 'row',\n    alignItems: 'center',\n    padding: 5,\n    borderBottomWidth: 1,\n    borderBottomColor: '#eee'\n  },\n  bold: {\n    fontWeight: 'bold'\n  },\n  smallText: { fontSize: 12 },\n  monoFont: {\n    fontFamily: 'monospace'\n  },\n  centerText: {\n    display: 'flex',\n    alignItems: 'center'\n  },\n  left: {\n    width: '50%'\n  },\n  right: {\n    flex: 1,\n    alignItems: 'flex-end'\n  }\n});\n\nexport default ReportCard;\n"
  },
  {
    "path": "packages/benchmarks/src/app/Text.js",
    "content": "import React from 'react';\nimport { StyleSheet, Text } from 'react-native';\nimport { bool } from 'prop-types';\nimport { colors } from './theme';\n\nclass AppText extends React.Component {\n  static displayName = '@app/Text';\n\n  static contextTypes = {\n    isInAParentText: bool\n  };\n\n  render() {\n    const { style, ...rest } = this.props;\n    const { isInAParentText } = this.context;\n    return (\n      <Text {...rest} style={[!isInAParentText && styles.baseText, style]} />\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  baseText: {\n    color: colors.textBlack,\n    fontSize: '1rem',\n    lineHeight: '1.3125em'\n  }\n});\n\nexport default AppText;\n"
  },
  {
    "path": "packages/benchmarks/src/app/theme.js",
    "content": "import { Dimensions, Platform } from 'react-native';\n\nconst baseFontSize = 14;\nconst baseUnit = 1.3125;\nconst canUseDOM = !!(\n  typeof window !== 'undefined' &&\n  window.document &&\n  window.document.createElement\n);\n\nconst createPlatformLength = (multiplier) =>\n  Platform.select({\n    web: `${multiplier}rem`,\n    default: multiplier * baseFontSize\n  });\n\n/**\n * Exported variables\n */\n\nexport const borderRadii = {\n  normal: Platform.select({ web: '0.35rem', default: 5 }),\n  infinite: '9999px'\n};\n\nexport const breakpoints = {\n  small: 360,\n  medium: 600,\n  large: 800,\n  xLarge: 1100\n};\n\n/**\n * Color palette\n * DO NOT add new colors unless they are part of @design's color palette.\n * DO NOT use colors that are not specified here.\n * source: go/uicolors\n */\nexport const colors = {\n  // Primary\n  blue: '#1DA1F2',\n  purple: '#794BC4',\n  green: '#17BF63',\n  yellow: '#FFAD1F',\n  orange: '#F45D22',\n  red: '#E0245E',\n  // Text and interface grays\n  textBlack: '#14171A',\n  deepGray: '#657786',\n  mediumGray: '#AAB8C2',\n  lightGray: '#CCD6DD',\n  fadedGray: '#E6ECF0',\n  faintGray: '#F5F8FA',\n  white: '#FFF',\n  textBlue: '#1B95E0'\n};\n\nexport const fontFamilies = {\n  normal: 'System',\n  japan: Platform.select({\n    web: 'Arial, \"ヒラギノ角ゴ Pro W3\", \"Hiragino Kaku Gothic Pro\", Osaka, \"メイリオ\", Meiryo, \"ＭＳ Ｐゴシック\", \"MS PGothic\", sans-serif',\n    default: 'System'\n  }),\n  rtl: Platform.select({ web: 'Tahoma, Arial, sans-serif', default: 'System' })\n};\n\nexport const fontSizes = {\n  // font scale\n  small: createPlatformLength(0.85),\n  normal: createPlatformLength(1),\n  large: createPlatformLength(1.25),\n  xLarge: createPlatformLength(1.5),\n  jumbo: createPlatformLength(2)\n};\n\nexport const lineHeight = Platform.select({ web: `${baseUnit}` });\n\nexport const spaces = {\n  // This set of space variables should be used for margin, padding\n  micro: createPlatformLength(baseUnit * 0.125),\n  xxSmall: createPlatformLength(baseUnit * 0.25),\n  xSmall: createPlatformLength(baseUnit * 0.5),\n  small: createPlatformLength(baseUnit * 0.75),\n  medium: createPlatformLength(baseUnit),\n  large: createPlatformLength(baseUnit * 1.5),\n  xLarge: createPlatformLength(baseUnit * 2),\n  xxLarge: createPlatformLength(baseUnit * 2.5),\n  jumbo: createPlatformLength(baseUnit * 3)\n};\n\n// On web, change the root font-size at specific breakpoints to scale the UI\n// for larger viewports.\nif (Platform.OS === 'web' && canUseDOM) {\n  const { medium, large } = breakpoints;\n  const htmlElement = document.documentElement;\n  const setFontSize = (width) => {\n    const fontSize =\n      width > medium ? (width > large ? '18px' : '17px') : '16px';\n    if (htmlElement) {\n      htmlElement.style.fontSize = fontSize;\n    }\n  };\n\n  setFontSize(Dimensions.get('window').width);\n  Dimensions.addEventListener('change', (dimensions) => {\n    setFontSize(dimensions.window.width);\n  });\n}\n"
  },
  {
    "path": "packages/benchmarks/src/cases/SierpinskiTriangle.js",
    "content": "import { BenchmarkType } from '../app/Benchmark';\nimport React from 'react';\nimport {\n  interpolatePurples,\n  interpolateBuPu,\n  interpolateRdPu\n} from 'd3-scale-chromatic';\n\nconst targetSize = 10;\n\nclass SierpinskiTriangle extends React.Component {\n  static displayName = 'SierpinskiTriangle';\n\n  static benchmarkType = BenchmarkType.UPDATE;\n\n  static defaultProps = {\n    depth: 0,\n    renderCount: 0\n  };\n\n  render() {\n    const { components, x, y, depth, renderCount } = this.props;\n    let { s } = this.props;\n    const { Dot } = components;\n\n    if (Dot) {\n      if (s <= targetSize) {\n        let fn;\n        switch (depth) {\n          case 1:\n            fn = interpolatePurples;\n            break;\n          case 2:\n            fn = interpolateBuPu;\n            break;\n          case 3:\n          default:\n            fn = interpolateRdPu;\n        }\n\n        // introduce randomness to ensure that repeated runs don't produce the same colors\n        const color = fn((renderCount * Math.random()) / 20);\n        return (\n          <Dot\n            color={color}\n            size={targetSize}\n            x={x - targetSize / 2}\n            y={y - targetSize / 2}\n          />\n        );\n      }\n\n      s /= 2;\n\n      return (\n        <React.Fragment>\n          <SierpinskiTriangle\n            components={components}\n            depth={1}\n            renderCount={renderCount}\n            s={s}\n            x={x}\n            y={y - s / 2}\n          />\n          <SierpinskiTriangle\n            components={components}\n            depth={2}\n            renderCount={renderCount}\n            s={s}\n            x={x - s}\n            y={y + s / 2}\n          />\n          <SierpinskiTriangle\n            components={components}\n            depth={3}\n            renderCount={renderCount}\n            s={s}\n            x={x + s}\n            y={y + s / 2}\n          />\n        </React.Fragment>\n      );\n    } else {\n      return (\n        <span style={{ color: 'white' }}>No implementation available</span>\n      );\n    }\n  }\n}\n\nexport default SierpinskiTriangle;\n"
  },
  {
    "path": "packages/benchmarks/src/cases/Tree.js",
    "content": "import { BenchmarkType } from '../app/Benchmark';\nimport React, { Component } from 'react';\n\nclass Tree extends Component {\n  static displayName = 'Tree';\n\n  static benchmarkType = BenchmarkType.MOUNT;\n\n  render() {\n    const { breadth, components, depth, id, wrap } = this.props;\n    const { Box } = components;\n\n    let result = (\n      <Box color={id % 3} layout={depth % 2 === 0 ? 'column' : 'row'} outer>\n        {depth === 0 && <Box color={(id % 3) + 3} fixed />}\n        {depth !== 0 &&\n          Array.from({ length: breadth }).map((el, i) => (\n            <Tree\n              breadth={breadth}\n              components={components}\n              depth={depth - 1}\n              id={i}\n              key={i}\n              wrap={wrap}\n            />\n          ))}\n      </Box>\n    );\n    for (let i = 0; i < wrap; i++) {\n      result = <Box>{result}</Box>;\n    }\n    return result;\n  }\n}\n\nexport default Tree;\n"
  },
  {
    "path": "packages/benchmarks/src/impl.js",
    "content": "/* @noflow */\n\nimport { type Component } from 'react';\nimport packageJson from '../package.json';\n\nconst context = require.context('./implementations/', true, /index\\.js$/);\nconst { dependencies } = packageJson;\n\ntype ComponentsType = {\n  Box: Component,\n  Dot: Component,\n  Provider: Component,\n  View: Component\n};\n\ntype ImplementationType = {\n  components: ComponentsType,\n  name: string,\n  version: string\n};\n\nconst toImplementations = (context: Object): Array<ImplementationType> =>\n  context.keys().map((path) => {\n    const components = context(path).default;\n    const name = path.split('/')[1];\n    const version = dependencies[name] || '';\n    return { components, name, version };\n  });\n\nconst toObject = (impls: Array<ImplementationType>): Object =>\n  impls.reduce((acc, impl) => {\n    acc[impl.name] = impl;\n    return acc;\n  }, {});\n\nconst map = toObject(toImplementations(context));\n\nexport default map;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/css-modules/Box.js",
    "content": "import classnames from 'classnames';\nimport React from 'react';\nimport View from './View';\nimport styles from './box-styles.css';\n\nconst Box = ({\n  color,\n  fixed = false,\n  layout = 'column',\n  outer = false,\n  ...other\n}) => (\n  <View\n    {...other}\n    className={classnames(styles[`color${color}`], {\n      [styles.fixed]: fixed,\n      [styles.outer]: outer,\n      [styles.row]: layout === 'row'\n    })}\n  />\n);\n\nexport default Box;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/css-modules/Dot.js",
    "content": "import React from 'react';\nimport styles from './dot-styles.css';\n\nconst Dot = ({ size, x, y, children, color }) => (\n  <div\n    className={styles.root}\n    style={{\n      borderBottomColor: color,\n      borderRightWidth: `${size / 2}px`,\n      borderBottomWidth: `${size / 2}px`,\n      borderLeftWidth: `${size / 2}px`,\n      marginLeft: `${x}px`,\n      marginTop: `${y}px`\n    }}\n  >\n    {children}\n  </div>\n);\n\nexport default Dot;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/css-modules/Provider.js",
    "content": "import View from './View';\nexport default View;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/css-modules/View.js",
    "content": "import classnames from 'classnames';\nimport React from 'react';\nimport styles from './view-styles.css';\n\nclass View extends React.Component {\n  render() {\n    const props = this.props;\n    return (\n      <div {...props} className={classnames(styles.initial, props.className)} />\n    );\n  }\n}\n\nexport default View;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/css-modules/box-styles.css",
    "content": ".outer {\n  align-self: flex-start;\n  padding: 4px;\n}\n\n.row {\n  flex-direction: row;\n}\n\n.color0 {\n  background-color: #14171A;\n}\n\n.color1 {\n  background-color: #AAB8C2;\n}\n\n.color2 {\n  background-color: #E6ECF0;\n}\n\n.color3 {\n  background-color: #FFAD1F;\n}\n\n.color4 {\n  background-color: #F45D22;\n}\n\n.color5 {\n  background-color: #E0245E;\n}\n\n.fixed {\n  width: 6px;\n  height: 6px;\n}\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/css-modules/dot-styles.css",
    "content": ".root {\n  position: absolute;\n  cursor: pointer;\n  width: 0;\n  height: 0;\n  border-color: transparent;\n  border-style: solid;\n  border-top-width: 0;\n  transform: translate(50%, 50%);\n}\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/css-modules/index.js",
    "content": "import Box from './Box';\nimport Dot from './Dot';\nimport Provider from './Provider';\nimport View from './View';\n\nexport default {\n  Box,\n  Dot,\n  Provider,\n  View\n};\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/css-modules/view-styles.css",
    "content": ".initial {\n  align-items: stretch;\n  background-color: transparent;\n  border-width: 0;\n  border-style: solid;\n  box-sizing: border-box;\n  display: flex;\n  flex-basis: auto;\n  flex-direction: column;\n  flex-shrink: 0;\n  list-style: none;\n  margin: 0;\n  min-height: 0;\n  min-width: 0;\n  padding: 0;\n  position: relative;\n  z-index: 0;\n}\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/inline-styles/Box.js",
    "content": "import React from 'react';\nimport View from './View';\n\nconst Box = ({\n  color,\n  fixed = false,\n  layout = 'column',\n  outer = false,\n  ...other\n}) => (\n  <View\n    {...other}\n    style={{\n      ...styles[`color${color}`],\n      ...(fixed && styles.fixed),\n      ...(layout === 'row' && styles.row),\n      ...(outer && styles.outer)\n    }}\n  />\n);\n\nconst styles = {\n  outer: {\n    alignSelf: 'flex-start',\n    padding: 4\n  },\n  row: {\n    flexDirection: 'row'\n  },\n  color0: {\n    backgroundColor: '#14171A'\n  },\n  color1: {\n    backgroundColor: '#AAB8C2'\n  },\n  color2: {\n    backgroundColor: '#E6ECF0'\n  },\n  color3: {\n    backgroundColor: '#FFAD1F'\n  },\n  color4: {\n    backgroundColor: '#F45D22'\n  },\n  color5: {\n    backgroundColor: '#E0245E'\n  },\n  fixed: {\n    width: 6,\n    height: 6\n  }\n};\n\nexport default Box;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/inline-styles/Dot.js",
    "content": "import React from 'react';\n\nconst Dot = ({ size, x, y, children, color }) => (\n  <div\n    style={Object.assign({}, styles.root, {\n      borderBottomColor: color,\n      borderRightWidth: `${size / 2}px`,\n      borderBottomWidth: `${size / 2}px`,\n      borderLeftWidth: `${size / 2}px`,\n      marginLeft: `${x}px`,\n      marginTop: `${y}px`\n    })}\n  >\n    {children}\n  </div>\n);\n\nconst styles = {\n  root: {\n    position: 'absolute',\n    cursor: 'pointer',\n    width: 0,\n    height: 0,\n    borderColor: 'transparent',\n    borderStyle: 'solid',\n    borderTopWidth: 0,\n    transform: 'translate(50%, 50%)'\n  }\n};\n\nexport default Dot;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/inline-styles/Provider.js",
    "content": "import View from './View';\nexport default View;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/inline-styles/View.js",
    "content": "import React from 'react';\n\nconst compose = (s1, s2) => {\n  if (s1 && s2) {\n    return { ...s1, ...s2 };\n  } else {\n    return s1 || s2;\n  }\n};\n\nclass View extends React.Component {\n  render() {\n    const { style, ...other } = this.props;\n    return <div {...other} style={compose(viewStyle, style)} />;\n  }\n}\n\nconst viewStyle = {\n  alignItems: 'stretch',\n  backgroundColor: 'transparent',\n  border: '0 solid black',\n  boxSizing: 'border-box',\n  display: 'flex',\n  flexBasis: 'auto',\n  flexDirection: 'column',\n  flexShrink: 0,\n  listStyle: 'none',\n  margin: 0,\n  minHeight: 0,\n  minWidth: 0,\n  padding: 0,\n  position: 'relative',\n  zIndex: 0\n};\n\nexport default View;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/inline-styles/index.js",
    "content": "import Box from './Box';\nimport Dot from './Dot';\nimport Provider from './Provider';\nimport View from './View';\n\nexport default {\n  Box,\n  Dot,\n  Provider,\n  View\n};\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/react-native-web/Box.js",
    "content": "import React from 'react';\nimport { StyleSheet, View } from 'react-native';\n\nconst Box = ({\n  color,\n  fixed = false,\n  layout = 'column',\n  outer = false,\n  ...other\n}) => (\n  <View\n    {...other}\n    style={[\n      styles[`color${color}`],\n      fixed && styles.fixed,\n      layout === 'row' && styles.row,\n      outer && styles.outer\n    ]}\n  />\n);\n\nconst styles = StyleSheet.create({\n  outer: {\n    alignSelf: 'flex-start',\n    padding: 4\n  },\n  row: {\n    flexDirection: 'row'\n  },\n  color0: {\n    backgroundColor: '#14171A'\n  },\n  color1: {\n    backgroundColor: '#AAB8C2'\n  },\n  color2: {\n    backgroundColor: '#E6ECF0'\n  },\n  color3: {\n    backgroundColor: '#FFAD1F'\n  },\n  color4: {\n    backgroundColor: '#F45D22'\n  },\n  color5: {\n    backgroundColor: '#E0245E'\n  },\n  fixed: {\n    width: 6,\n    height: 6\n  }\n});\n\nexport default Box;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/react-native-web/Dot.js",
    "content": "import {\n  unstable_createElement as createElement,\n  StyleSheet\n} from 'react-native';\n\nconst Dot = ({ size, x, y, children, color }) =>\n  createElement('div', {\n    children,\n    style: [\n      styles.root,\n      {\n        borderBottomColor: color,\n        borderRightWidth: size / 2,\n        borderBottomWidth: size / 2,\n        borderLeftWidth: size / 2,\n        marginLeft: x,\n        marginTop: y\n      }\n    ]\n  });\n\nconst styles = StyleSheet.create({\n  root: {\n    position: 'absolute',\n    cursor: 'pointer',\n    width: 0,\n    height: 0,\n    borderColor: 'transparent',\n    borderStyle: 'solid',\n    borderTopWidth: 0,\n    transform: [{ translateX: '50%' }, { translateY: '50%' }]\n  }\n});\n\nexport default Dot;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/react-native-web/Provider.js",
    "content": "import { View } from 'react-native';\nexport default View;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/react-native-web/index.js",
    "content": "import Box from './Box';\nimport Dot from './Dot';\nimport Provider from './Provider';\nimport { View } from 'react-native';\n\nexport default {\n  Box,\n  Dot,\n  Provider,\n  View\n};\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/styleq/Box.js",
    "content": "import React from 'react';\nimport View from './View';\n\nconst Box = ({\n  color,\n  fixed = false,\n  layout = 'column',\n  outer = false,\n  ...other\n}) => (\n  <View\n    {...other}\n    style={[\n      styles[`color${color}`],\n      fixed && styles.fixed,\n      layout === 'row' && styles.row,\n      outer && styles.outer\n    ]}\n  />\n);\n\nconst styles = {\n  outer: {\n    $$css: true,\n    alignSelf: 'r-k200y',\n    padding: 'r-tuq35u'\n  },\n  row: {\n    $$css: true,\n    flexDirection: 'r-18u37iz'\n  },\n  color0: {\n    $$css: true,\n    backgroundColor: 'r-1810x6o'\n  },\n  color1: {\n    $$css: true,\n    backgroundColor: 'r-dkge59'\n  },\n  color2: {\n    $$css: true,\n    backgroundColor: 'r-18z3xeu'\n  },\n  color3: {\n    $$css: true,\n    backgroundColor: 'r-1vkxrha'\n  },\n  color4: {\n    $$css: true,\n    backgroundColor: 'r-18z3xeu'\n  },\n  color5: {\n    $$css: true,\n    backgroundColor: 'r-e84r5y'\n  },\n  fixed: {\n    $$css: true,\n    width: 'r-8hc5te',\n    height: 'r-1xbve24'\n  }\n};\n\nexport default Box;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/styleq/Dot.js",
    "content": "import React from 'react';\nimport { styleq } from 'styleq';\n\nconst Dot = ({ size, x, y, children, color }) => {\n  const [className, inlineStyle] = styleq([\n    styles.root,\n    {\n      borderBottomColor: color,\n      borderRightWidth: size / 2,\n      borderBottomWidth: size / 2,\n      borderLeftWidth: size / 2,\n      marginLeft: x,\n      marginTop: y\n    }\n  ]);\n\n  return <div children={children} className={className} style={inlineStyle} />;\n};\n\nconst styles = {\n  root: {\n    $$css: true,\n    'css-1co75s2': 'css-1co75s2'\n  }\n};\n\nexport default Dot;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/styleq/Provider.js",
    "content": "import View from './View';\nexport default View;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/styleq/View.js",
    "content": "import React from 'react';\nimport { styleq } from 'styleq';\n\nconst q = styleq.factory({ disableCache: false });\n\nfunction View(props) {\n  const [className, inlineStyle] = q([styles.root, props.style]);\n  return <div {...props} className={className} style={inlineStyle} />;\n}\n\nconst styles = {\n  root: {\n    $$css: true,\n    'css-wkmxpp': 'css-wkmxpp'\n  }\n};\n\nexport default View;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/styleq/index.js",
    "content": "import Box from './Box';\nimport Dot from './Dot';\nimport Provider from './Provider';\nimport View from './View';\n\nexport default {\n  Box,\n  Dot,\n  Provider,\n  View\n};\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/stylesheet/Box.js",
    "content": "import React from 'react';\nimport View from './View';\nimport { StyleSheet } from 'react-native-web';\n\nconst Box = ({\n  color,\n  fixed = false,\n  layout = 'column',\n  outer = false,\n  ...other\n}) => (\n  <View\n    {...other}\n    style={[\n      styles[`color${color}`],\n      fixed && styles.fixed,\n      layout === 'row' && styles.row,\n      outer && styles.outer\n    ]}\n  />\n);\n\nconst styles = StyleSheet.create({\n  outer: {\n    alignSelf: 'flex-start',\n    padding: 4\n  },\n  row: {\n    flexDirection: 'row'\n  },\n  color0: {\n    backgroundColor: '#14171A'\n  },\n  color1: {\n    backgroundColor: '#AAB8C2'\n  },\n  color2: {\n    backgroundColor: '#E6ECF0'\n  },\n  color3: {\n    backgroundColor: '#FFAD1F'\n  },\n  color4: {\n    backgroundColor: '#F45D22'\n  },\n  color5: {\n    backgroundColor: '#E0245E'\n  },\n  fixed: {\n    width: 6,\n    height: 6\n  }\n});\n\nexport default Box;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/stylesheet/Dot.js",
    "content": "import React from 'react';\nimport { StyleSheet } from 'react-native-web';\n\nconst Dot = ({ size, x, y, children, color }) => {\n  const [className, inlineStyle] = StyleSheet([\n    styles.root$raw,\n    {\n      borderBottomColor: color,\n      borderRightWidth: size / 2,\n      borderBottomWidth: size / 2,\n      borderLeftWidth: size / 2,\n      marginLeft: x,\n      marginTop: y\n    }\n  ]);\n\n  return <div children={children} className={className} style={inlineStyle} />;\n};\n\nconst styles = StyleSheet.create({\n  root$raw: {\n    position: 'absolute',\n    cursor: 'pointer',\n    width: 0,\n    height: 0,\n    borderColor: 'transparent',\n    borderStyle: 'solid',\n    borderTopWidth: 0,\n    transform: 'translateX(50%) translateY(50%)'\n  }\n});\n\nexport default Dot;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/stylesheet/Provider.js",
    "content": "import View from './View';\nexport default View;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/stylesheet/View.js",
    "content": "import React from 'react';\nimport { StyleSheet } from 'react-native-web';\n\nfunction View(props) {\n  const [className, inlineStyle] = StyleSheet([styles.root$raw, props.style]);\n  return <div {...props} className={className} style={inlineStyle} />;\n}\n\nconst styles = StyleSheet.create({\n  root$raw: {\n    alignItems: 'stretch',\n    backgroundColor: 'transparent',\n    border: '0 solid black',\n    boxSizing: 'border-box',\n    display: 'flex',\n    flexBasis: 'auto',\n    flexDirection: 'column',\n    flexShrink: 0,\n    listStyle: 'none',\n    margin: 0,\n    minHeight: 0,\n    minWidth: 0,\n    padding: 0,\n    position: 'relative',\n    zIndex: 0\n  }\n});\n\nexport default View;\n"
  },
  {
    "path": "packages/benchmarks/src/implementations/stylesheet/index.js",
    "content": "import Box from './Box';\nimport Dot from './Dot';\nimport Provider from './Provider';\nimport View from './View';\n\nexport default {\n  Box,\n  Dot,\n  Provider,\n  View\n};\n"
  },
  {
    "path": "packages/benchmarks/src/index.js",
    "content": "import App from './app/App';\nimport impl from './impl';\nimport Tree from './cases/Tree';\nimport SierpinskiTriangle from './cases/SierpinskiTriangle';\n\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\n\nconst implementations = impl;\nconst packageNames = Object.keys(implementations);\n\nconst createTestBlock = (fn) => {\n  return packageNames.reduce((testSetups, packageName) => {\n    const { name, components, version } = implementations[packageName];\n    const {\n      Component,\n      getComponentProps,\n      sampleCount,\n      Provider,\n      benchmarkType\n    } = fn(components);\n\n    testSetups[packageName] = {\n      Component,\n      getComponentProps,\n      sampleCount,\n      Provider,\n      benchmarkType,\n      version,\n      name\n    };\n    return testSetups;\n  }, {});\n};\n\nconst tests = {\n  'Mount deep tree': createTestBlock((components) => ({\n    benchmarkType: 'mount',\n    Component: Tree,\n    getComponentProps: () => ({\n      breadth: 2,\n      components,\n      depth: 7,\n      id: 0,\n      wrap: 1\n    }),\n    Provider: components.Provider,\n    sampleCount: 50\n  })),\n  'Mount wide tree': createTestBlock((components) => ({\n    benchmarkType: 'mount',\n    Component: Tree,\n    getComponentProps: () => ({\n      breadth: 6,\n      components,\n      depth: 3,\n      id: 0,\n      wrap: 2\n    }),\n    Provider: components.Provider,\n    sampleCount: 50\n  })),\n  'Update dynamic styles': createTestBlock((components) => ({\n    benchmarkType: 'update',\n    Component: SierpinskiTriangle,\n    getComponentProps: ({ cycle }) => {\n      return { components, s: 200, renderCount: cycle, x: 0, y: 0 };\n    },\n    Provider: components.Provider,\n    sampleCount: 100\n  }))\n};\n\nconst root = document.querySelector('.root');\nconst element = <App tests={tests} />;\n\ncreateRoot(root).render(element);\n"
  },
  {
    "path": "packages/benchmarks/webpack.config.js",
    "content": "const BundleAnalyzerPlugin =\n  require('webpack-bundle-analyzer').BundleAnalyzerPlugin;\nconst path = require('path');\n\nconst appDirectory = path.resolve(__dirname);\n\nmodule.exports = {\n  mode: 'production',\n  context: __dirname,\n  entry: './src/index',\n  output: {\n    path: path.resolve(appDirectory, 'dist'),\n    filename: 'bundle.js'\n  },\n  optimization: {\n    minimize: process.env.NODE_ENV === 'production'\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.css$/,\n        use: [\n          'style-loader',\n          {\n            loader: 'css-loader',\n            options: {\n              modules: {\n                localIdentName: '[hash:base64:8]'\n              }\n            }\n          }\n        ]\n      },\n      {\n        test: /\\.js$/,\n        include: [path.resolve(appDirectory, 'src')],\n        use: {\n          loader: 'babel-loader',\n          options: {\n            cacheDirectory: false,\n            extends: path.resolve(appDirectory, '../../configs/babel.config')\n          }\n        }\n      }\n    ]\n  },\n  plugins: [\n    new BundleAnalyzerPlugin({\n      analyzerMode: 'static',\n      openAnalyzer: false\n    })\n  ],\n  resolve: {\n    alias: {\n      'react-native': 'react-native-web'\n    }\n  }\n};\n"
  },
  {
    "path": "packages/dom-event-testing-library/LICENSE",
    "content": "MIT License\n\nCopyright (c) Nicolas Gallagher.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "packages/dom-event-testing-library/README.md",
    "content": "# `dom-event-testing-library`\n\nA library for unit testing high-level interactions via simple pointer events, e.g., `pointerdown`, that produce realistic and complete DOM event sequences.\n\nThere are number of challenges involved in unit testing modules that work with DOM events.\n\n1. Testing environments with and without support for the `PointerEvent` API.\n2. Testing various user interaction modes including mouse, touch, and pen use.\n3. Testing against the event sequences browsers actually produce (e.g., emulated touch and mouse events.)\n4. Testing against the event properties DOM events include (i.e., more complete mock data)\n5. Testing against \"virtual\" events produced by tools like screen-readers.\n\nWriting unit tests to cover all these scenarios is tedious and error prone. This event testing library is designed to avoid these issues by allowing developers to more easily dispatch events in unit tests, and to more reliably test interactions while using an API based on `PointerEvent`.\n\n## Example\n\n```js\nimport {\n  describeWithPointerEvent,\n  testWithPointerType,\n  clearPointers,\n  createEventTarget,\n  setPointerEvent,\n} from 'dom-event-testing-library';\n\ndescribeWithPointerEvent('useTap', hasPointerEvent => {\n  beforeEach(() => {\n    // basic PointerEvent mock\n    setPointerEvent(hasPointerEvent);\n  });\n\n  afterEach(() => {\n    // clear active pointers between test runs\n    clearPointers();\n  });\n\n  // test all the pointer types supported by the environment\n  testWithPointerType('pointer down', pointerType => {\n    const ref = createRef(null);\n    const onTapStart = jest.fn();\n\n    // component to test\n    function Component() {\n      useTapEvents(ref, { onTapStart });\n      return <div ref={ref} />\n    }\n\n    // render component\n    act(() => {\n      render(<Component />);\n    });\n\n    // create an event target\n    const target = createEventTarget(ref.current);\n\n    // dispatch high-level pointer event\n    act(() => {\n      target.pointerdown({ pointerType });\n    });\n\n    // assertion\n    expect(onTapStart).toBeCalled();\n  });\n});\n```\n\nThe example above tests the interaction in multiple scenarios. In each case, a realistic DOM event sequence–with complete mock events–is produced. When running in a mock environment without the `PointerEvent` API, the test runs for both `mouse` and `touch` pointer types. When `touch` is the pointer type it produces emulated mouse events. When running in a mock environment with the `PointerEvent` API, the test runs for `mouse`, `touch`, and `pen` pointer types.\n\nIt's important to cover all these scenarios because it's very easy to introduce bugs – e.g., double calling of callbacks – if not accounting for emulated mouse events, differences in target capturing between `touch` and `mouse` pointers, and the different semantics of `button` across event APIs.\n\nDefault values are provided for the expected native events properties. They can also be customized as needed in a test.\n\n```js\ntarget.pointerdown({\n  button: 0,\n  buttons: 1,\n  pageX: 10,\n  pageY: 10,\n  pointerType,\n  // NOTE: use x,y instead of clientX,clientY\n  x: 10,\n  y: 10\n});\n```\n\nTests that dispatch multiple pointer events will dispatch multi-touch native events on the target.\n\n```js\n// first pointer is active\ntarget.pointerdown({pointerId: 1, pointerType});\n// second pointer is active\ntarget.pointerdown({pointerId: 2, pointerType});\n```\n\n## API\n\n### Target and events\n\nTo create a new event target pass the DOM node to `createEventTarget(node)`. This target can then be used to dispatch event sequences and customize the event payload. The following are currently supported:\n\n* `blur`\n* `click`\n* `contextmenu`\n* `focus` (includes the complete sequence of focus-related events)\n* `keydown`\n* `keyup`\n* `pointercancel`\n* `pointerdown`\n* `pointerhover` (moves when pointer is not down)\n* `pointermove` (moves when pointer is down)\n* `pointerover`\n* `pointerout`\n* `scroll`\n* `select`\n* `selectionchange`\n* `tap` (equivalent to `pointerdown` followed by `pointerup`)\n* `virtualclick`\n\nThe target also has `node` property equal to the node that was used to create the target, and a `setBoundClientRect({x,y,width,height})` method that can be used to mock the return value of `getBoundingClientRect`.\n\n### Jest helpers\n\n#### `describeWithPointerEvent`\n\nThis is just like `describe` but it will run the entire test suite twice, once in an environment with `PointerEvent` mocked and once without.\n\n```js\ndescribeWithPointerEvent('useTap', hasPointerEvent => {\n  // test suite\n});\n```\n\n#### `testWithPointerType`\n\nThe is just like `test` but it will run the test for every pointer type supported by the environment. When `PointerEvent` is mocked, the pointer types will be `mouse`, `touch`, and `pen`; otherwise the pointer types will be `mouse` and `touch`.\n\n```js\ntestWithPointerType('pointer down', pointerType => {\n  // test unit\n});\n```\n\n### jsdom environment helpers\n\n#### platform\n\nInteractions that account for Windows / macOS differences can change the platform by calling `platform.set(value)`, where `value` can be either `'mac'` or `'windows'`. To retreive the current platform call `platform.get()`, and the clear it call `platform.clear()`.\n\n#### hasPointerEvent / setPointerEvent\n\nInteractions implemented using `PointerEvent` can create a basic mock for jsdom by calling `setPointerEvent(true)` (disable with `setPointerEvent(false)`), and check whether `PointerEvent` is available by calling `hasPointerEvent()`.\n"
  },
  {
    "path": "packages/dom-event-testing-library/index.js",
    "content": "export * from './src/index';\n"
  },
  {
    "path": "packages/dom-event-testing-library/package.json",
    "content": "{\n  \"private\": true,\n  \"name\": \"dom-event-testing-library\",\n  \"version\": \"0.0.0\",\n  \"main\": \"index.js\",\n  \"description\": \"Browser event sequences for unit tests\",\n  \"author\": \"Nicolas Gallagher\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/necolas/react-native-web/tree/master/packages/dom-event-testing-library\"\n}\n"
  },
  {
    "path": "packages/dom-event-testing-library/src/__tests__/__snapshots__/index-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`describeWithPointerEvent: MouseEvent/TouchEvent provides boolean to tests 1`] = `false`;\n\nexports[`describeWithPointerEvent: MouseEvent/TouchEvent testWithPointerType: mouse 1`] = `\"mouse\"`;\n\nexports[`describeWithPointerEvent: MouseEvent/TouchEvent testWithPointerType: touch 1`] = `\"touch\"`;\n\nexports[`describeWithPointerEvent: PointerEvent provides boolean to tests 1`] = `true`;\n\nexports[`describeWithPointerEvent: PointerEvent testWithPointerType: mouse 1`] = `\"mouse\"`;\n\nexports[`describeWithPointerEvent: PointerEvent testWithPointerType: pen 1`] = `\"pen\"`;\n\nexports[`describeWithPointerEvent: PointerEvent testWithPointerType: touch 1`] = `\"touch\"`;\n"
  },
  {
    "path": "packages/dom-event-testing-library/src/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nimport { defaultBrowserChromeSize } from '../constants';\n\nimport {\n  clearPointers,\n  createEventTarget,\n  describeWithPointerEvent,\n  testWithPointerType\n} from '../index';\n\n/**\n * Unit test helpers\n */\ndescribeWithPointerEvent('describeWithPointerEvent', (pointerEvent) => {\n  test('provides boolean to tests', () => {\n    expect(pointerEvent).toMatchSnapshot();\n  });\n\n  testWithPointerType('testWithPointerType', (pointerType) => {\n    expect(pointerType).toMatchSnapshot();\n  });\n});\n\n/**\n * createEventTarget\n */\ndescribe('createEventTarget', () => {\n  let node;\n  beforeEach(() => {\n    node = document.createElement('div');\n  });\n\n  afterEach(() => {\n    node = null;\n    clearPointers();\n  });\n\n  test('returns expected API', () => {\n    const target = createEventTarget(node);\n    expect(target.node).toEqual(node);\n    expect(Object.keys(target)).toMatchInlineSnapshot(`\n      [\n        \"node\",\n        \"blur\",\n        \"click\",\n        \"contextmenu\",\n        \"error\",\n        \"focus\",\n        \"keydown\",\n        \"keyup\",\n        \"load\",\n        \"pointercancel\",\n        \"pointerdown\",\n        \"pointerhover\",\n        \"pointermove\",\n        \"pointerover\",\n        \"pointerout\",\n        \"pointerup\",\n        \"scroll\",\n        \"select\",\n        \"selectionchange\",\n        \"tap\",\n        \"virtualclick\",\n        \"setBoundingClientRect\",\n      ]\n    `);\n  });\n\n  /**\n   * Simple events\n   */\n\n  describe('.blur()', () => {\n    test('default', () => {\n      const target = createEventTarget(node);\n      node.addEventListener('blur', (e) => {\n        expect(e.relatedTarget).toBeNull();\n      });\n      target.blur();\n    });\n\n    test('custom payload', () => {\n      const target = createEventTarget(node);\n      const relatedTarget = document.createElement('div');\n      node.addEventListener('blur', (e) => {\n        expect(e.relatedTarget).toBe(relatedTarget);\n      });\n      target.blur({ relatedTarget });\n    });\n  });\n\n  describe('.click()', () => {\n    test('default', () => {\n      const target = createEventTarget(node);\n      node.addEventListener('click', (e) => {\n        expect(e.altKey).toEqual(false);\n        expect(e.button).toEqual(0);\n        expect(e.buttons).toEqual(0);\n        expect(e.clientX).toEqual(0);\n        expect(e.clientY).toEqual(0);\n        expect(e.ctrlKey).toEqual(false);\n        expect(e.detail).toEqual(1);\n        expect(typeof e.getModifierState).toEqual('function');\n        expect(e.metaKey).toEqual(false);\n        expect(e.movementX).toEqual(0);\n        expect(e.movementY).toEqual(0);\n        expect(e.offsetX).toEqual(0);\n        expect(e.offsetY).toEqual(0);\n        expect(e.pageX).toEqual(0);\n        expect(e.pageY).toEqual(0);\n        expect(typeof e.preventDefault).toEqual('function');\n        expect(e.screenX).toEqual(0);\n        expect(e.screenY).toEqual(defaultBrowserChromeSize);\n        expect(e.shiftKey).toEqual(false);\n        expect(typeof e.timeStamp).toEqual('number');\n      });\n      target.click();\n    });\n\n    test('custom payload', () => {\n      const target = createEventTarget(node);\n      node.addEventListener('click', (e) => {\n        expect(e.altKey).toEqual(true);\n        expect(e.button).toEqual(1);\n        expect(e.buttons).toEqual(4);\n        expect(e.clientX).toEqual(10);\n        expect(e.clientY).toEqual(20);\n        expect(e.ctrlKey).toEqual(true);\n        expect(e.metaKey).toEqual(true);\n        expect(e.movementX).toEqual(1);\n        expect(e.movementY).toEqual(2);\n        expect(e.offsetX).toEqual(5);\n        expect(e.offsetY).toEqual(5);\n        expect(e.pageX).toEqual(50);\n        expect(e.pageY).toEqual(50);\n        expect(e.screenX).toEqual(10);\n        expect(e.screenY).toEqual(20 + defaultBrowserChromeSize);\n        expect(e.shiftKey).toEqual(true);\n      });\n      target.click({\n        altKey: true,\n        button: 1,\n        buttons: 4,\n        x: 10,\n        y: 20,\n        ctrlKey: true,\n        metaKey: true,\n        movementX: 1,\n        movementY: 2,\n        offsetX: 5,\n        offsetY: 5,\n        pageX: 50,\n        pageY: 50,\n        shiftKey: true\n      });\n    });\n  });\n\n  describe('.focus()', () => {\n    test('default', () => {\n      const target = createEventTarget(node);\n      node.addEventListener('focus', (e) => {\n        expect(e.relatedTarget).toBeNull();\n      });\n      target.focus();\n    });\n\n    test('custom payload', () => {\n      const target = createEventTarget(node);\n      const relatedTarget = document.createElement('div');\n      node.addEventListener('focus', (e) => {\n        expect(e.relatedTarget).toBe(relatedTarget);\n      });\n      target.focus({ relatedTarget });\n    });\n  });\n\n  describe('.keydown()', () => {\n    test('default', () => {\n      const target = createEventTarget(node);\n      node.addEventListener('keydown', (e) => {\n        expect(e.altKey).toEqual(false);\n        expect(e.ctrlKey).toEqual(false);\n        expect(typeof e.getModifierState).toEqual('function');\n        expect(e.key).toEqual('');\n        expect(e.metaKey).toEqual(false);\n        expect(typeof e.preventDefault).toEqual('function');\n        expect(e.shiftKey).toEqual(false);\n        expect(typeof e.timeStamp).toEqual('number');\n      });\n      target.keydown();\n    });\n\n    test('custom payload', () => {\n      const target = createEventTarget(node);\n      node.addEventListener('keydown', (e) => {\n        expect(e.altKey).toEqual(true);\n        expect(e.ctrlKey).toEqual(true);\n        expect(e.isComposing).toEqual(true);\n        expect(e.key).toEqual('Enter');\n        expect(e.metaKey).toEqual(true);\n        expect(e.shiftKey).toEqual(true);\n      });\n      target.keydown({\n        altKey: true,\n        ctrlKey: true,\n        isComposing: true,\n        key: 'Enter',\n        metaKey: true,\n        shiftKey: true\n      });\n    });\n  });\n\n  describe('.keyup()', () => {\n    test('default', () => {\n      const target = createEventTarget(node);\n      node.addEventListener('keyup', (e) => {\n        expect(e.altKey).toEqual(false);\n        expect(e.ctrlKey).toEqual(false);\n        expect(typeof e.getModifierState).toEqual('function');\n        expect(e.key).toEqual('');\n        expect(e.metaKey).toEqual(false);\n        expect(typeof e.preventDefault).toEqual('function');\n        expect(e.shiftKey).toEqual(false);\n        expect(typeof e.timeStamp).toEqual('number');\n      });\n      target.keydown();\n    });\n\n    test('custom payload', () => {\n      const target = createEventTarget(node);\n      node.addEventListener('keyup', (e) => {\n        expect(e.altKey).toEqual(true);\n        expect(e.ctrlKey).toEqual(true);\n        expect(e.isComposing).toEqual(true);\n        expect(e.key).toEqual('Enter');\n        expect(e.metaKey).toEqual(true);\n        expect(e.shiftKey).toEqual(true);\n      });\n      target.keyup({\n        altKey: true,\n        ctrlKey: true,\n        isComposing: true,\n        key: 'Enter',\n        metaKey: true,\n        shiftKey: true\n      });\n    });\n  });\n\n  describe('.scroll()', () => {\n    test('default', () => {\n      const target = createEventTarget(node);\n      node.addEventListener('scroll', (e) => {\n        expect(e.type).toEqual('scroll');\n      });\n      target.scroll();\n    });\n  });\n\n  describe('.virtualclick()', () => {\n    test('default', () => {\n      const target = createEventTarget(node);\n      node.addEventListener('click', (e) => {\n        expect(e.altKey).toEqual(false);\n        expect(e.button).toEqual(0);\n        expect(e.buttons).toEqual(0);\n        expect(e.clientX).toEqual(0);\n        expect(e.clientY).toEqual(0);\n        expect(e.ctrlKey).toEqual(false);\n        expect(e.detail).toEqual(0);\n        expect(typeof e.getModifierState).toEqual('function');\n        expect(e.metaKey).toEqual(false);\n        expect(e.movementX).toEqual(0);\n        expect(e.movementY).toEqual(0);\n        expect(e.offsetX).toEqual(0);\n        expect(e.offsetY).toEqual(0);\n        expect(e.pageX).toEqual(0);\n        expect(e.pageY).toEqual(0);\n        expect(typeof e.preventDefault).toEqual('function');\n        expect(e.screenX).toEqual(0);\n        expect(e.screenY).toEqual(0);\n        expect(e.shiftKey).toEqual(false);\n        expect(typeof e.timeStamp).toEqual('number');\n      });\n      target.virtualclick();\n    });\n\n    test('custom payload', () => {\n      const target = createEventTarget(node);\n      node.addEventListener('click', (e) => {\n        // expect most of the custom payload to be ignored\n        expect(e.altKey).toEqual(true);\n        expect(e.button).toEqual(1);\n        expect(e.buttons).toEqual(0);\n        expect(e.clientX).toEqual(0);\n        expect(e.clientY).toEqual(0);\n        expect(e.ctrlKey).toEqual(true);\n        expect(e.detail).toEqual(0);\n        expect(e.metaKey).toEqual(true);\n        expect(e.pageX).toEqual(0);\n        expect(e.pageY).toEqual(0);\n        expect(e.screenX).toEqual(0);\n        expect(e.screenY).toEqual(0);\n        expect(e.shiftKey).toEqual(true);\n      });\n      target.virtualclick({\n        altKey: true,\n        button: 1,\n        buttons: 4,\n        x: 10,\n        y: 20,\n        ctrlKey: true,\n        metaKey: true,\n        pageX: 50,\n        pageY: 50,\n        shiftKey: true\n      });\n    });\n  });\n\n  /**\n   * TODO: Complex event sequences\n   */\n\n  /**\n   * Other APIs\n   */\n\n  test('.setBoundingClientRect()', () => {\n    const target = createEventTarget(node);\n    expect(node.getBoundingClientRect()).toMatchInlineSnapshot(`\n      {\n        \"bottom\": 0,\n        \"height\": 0,\n        \"left\": 0,\n        \"right\": 0,\n        \"top\": 0,\n        \"width\": 0,\n        \"x\": 0,\n        \"y\": 0,\n      }\n    `);\n    target.setBoundingClientRect({ x: 10, y: 20, width: 100, height: 200 });\n    expect(node.getBoundingClientRect()).toMatchInlineSnapshot(`\n      {\n        \"bottom\": 220,\n        \"height\": 200,\n        \"left\": 10,\n        \"right\": 110,\n        \"top\": 20,\n        \"width\": 100,\n        \"x\": 10,\n        \"y\": 20,\n      }\n    `);\n  });\n});\n"
  },
  {
    "path": "packages/dom-event-testing-library/src/constants.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nexport const defaultPointerId = 1;\nexport const defaultPointerSize = 23;\nexport const defaultBrowserChromeSize = 50;\n\n/**\n * Button property\n * This property only guarantees to indicate which buttons are pressed during events caused by pressing or\n * releasing one or multiple buttons. As such, it is not reliable for events such as 'mouseenter', 'mouseleave',\n * 'mouseover', 'mouseout' or 'mousemove'. Furthermore, the semantics differ for PointerEvent, where the value\n * for 'pointermove' will always be -1.\n */\n\nexport const buttonType = {\n  // no change since last event\n  none: -1,\n  // left-mouse\n  // touch contact\n  // pen contact\n  primary: 0,\n  // right-mouse\n  // pen barrel button\n  secondary: 2,\n  // middle mouse\n  auxiliary: 1,\n  // back mouse\n  back: 3,\n  // forward mouse\n  forward: 4,\n  // pen eraser\n  eraser: 5\n};\n\n/**\n * Buttons bitmask\n */\n\nexport const buttonsType = {\n  none: 0,\n  // left-mouse\n  // touch contact\n  // pen contact\n  primary: 1,\n  // right-mouse\n  // pen barrel button\n  secondary: 2,\n  // middle mouse\n  auxiliary: 4,\n  // back mouse\n  back: 8,\n  // forward mouse\n  forward: 16,\n  // pen eraser\n  eraser: 32\n};\n"
  },
  {
    "path": "packages/dom-event-testing-library/src/createEvent.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nconst defaultConfig = {\n  constructorType: 'Event',\n  defaultInit: { bubbles: true, cancelable: true, composed: true }\n};\n\nconst eventConfigs = {\n  blur: {\n    constructorType: 'FocusEvent',\n    defaultInit: { bubbles: false, cancelable: false, composed: true }\n  },\n  change: {\n    constructorType: 'Event',\n    defaultInit: { bubbles: true, cancelable: false }\n  },\n  click: {\n    constructorType: 'MouseEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  compositionend: {\n    constructorType: 'CompositionEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  compositionstart: {\n    constructorType: 'CompositionEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  compositionupdate: {\n    constructorType: 'CompositionEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  contextmenu: {\n    constructorType: 'MouseEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  dblclick: {\n    constructorType: 'MouseEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  drag: {\n    constructorType: 'MouseEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  dragend: {\n    constructorType: 'MouseEvent',\n    defaultInit: { bubbles: true, cancelable: false, composed: true }\n  },\n  dragenter: {\n    constructorType: 'MouseEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  dragexit: {\n    constructorType: 'MouseEvent',\n    defaultInit: { bubbles: true, cancelable: false, composed: true }\n  },\n  dragleave: {\n    constructorType: 'MouseEvent',\n    defaultInit: { bubbles: true, cancelable: false, composed: true }\n  },\n  dragover: {\n    constructorType: 'MouseEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  dragstart: {\n    constructorType: 'MouseEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  drop: {\n    constructorType: 'MouseEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  error: {\n    constructorType: 'Event',\n    defaultInit: { bubbles: false, cancelable: false }\n  },\n  focus: {\n    constructorType: 'FocusEvent',\n    defaultInit: { bubbles: false, cancelable: false, composed: true }\n  },\n  focusin: {\n    constructorType: 'FocusEvent',\n    defaultInit: { bubbles: true, cancelable: false, composed: true }\n  },\n  focusout: {\n    constructorType: 'FocusEvent',\n    defaultInit: { bubbles: true, cancelable: false, composed: true }\n  },\n  input: {\n    constructorType: 'InputEvent',\n    defaultInit: { bubbles: true, cancelable: false, composed: true }\n  },\n  invalid: {\n    constructorType: 'Event',\n    defaultInit: { bubbles: false, cancelable: true }\n  },\n  keydown: {\n    constructorType: 'KeyboardEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  keyup: {\n    constructorType: 'KeyboardEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  load: {\n    constructorType: 'UIEvent',\n    defaultInit: { bubbles: false, cancelable: false }\n  },\n  mousedown: {\n    constructorType: 'MouseEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  mouseenter: {\n    constructorType: 'MouseEvent',\n    defaultInit: { bubbles: false, cancelable: false, composed: true }\n  },\n  mouseleave: {\n    constructorType: 'MouseEvent',\n    defaultInit: { bubbles: false, cancelable: false, composed: true }\n  },\n  mousemove: {\n    constructorType: 'MouseEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  mouseout: {\n    constructorType: 'MouseEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  mouseover: {\n    constructorType: 'MouseEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  mouseup: {\n    constructorType: 'MouseEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  scroll: {\n    constructorType: 'UIEvent',\n    defaultInit: { bubbles: false, cancelable: false }\n  },\n  select: {\n    constructorType: 'Event',\n    defaultInit: { bubbles: true, cancelable: false }\n  },\n  submit: {\n    constructorType: 'Event',\n    defaultInit: { bubbles: true, cancelable: true }\n  },\n  touchcancel: {\n    constructorType: 'TouchEvent',\n    defaultInit: { bubbles: true, cancelable: false, composed: true }\n  },\n  touchend: {\n    constructorType: 'TouchEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  touchmove: {\n    constructorType: 'TouchEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  touchstart: {\n    constructorType: 'TouchEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  // 'PointerEvent' constructor is not supported in jsdom\n  gotpointercapture: {\n    constructorType: 'Event',\n    defaultInit: { bubbles: false, cancelable: false, composed: true }\n  },\n  lostpointercapture: {\n    constructorType: 'Event',\n    defaultInit: { bubbles: false, cancelable: false, composed: true }\n  },\n  pointercancel: {\n    constructorType: 'Event',\n    defaultInit: { bubbles: true, cancelable: false, composed: true }\n  },\n  pointerdown: {\n    constructorType: 'Event',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  pointerenter: {\n    constructorType: 'Event',\n    defaultInit: { bubbles: false, cancelable: false }\n  },\n  pointerleave: {\n    constructorType: 'Event',\n    defaultInit: { bubbles: false, cancelable: false }\n  },\n  pointermove: {\n    constructorType: 'Event',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  pointerout: {\n    constructorType: 'Event',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  pointerover: {\n    constructorType: 'Event',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  pointerup: {\n    constructorType: 'Event',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  },\n  wheel: {\n    constructorType: 'WheelEvent',\n    defaultInit: { bubbles: true, cancelable: true, composed: true }\n  }\n};\n\nfunction getEventConfig(type) {\n  return eventConfigs[type] || defaultConfig;\n}\n\nexport default function createEvent(type, init) {\n  const config = getEventConfig(type);\n  const { constructorType, defaultInit } = config;\n  const eventInit = { ...defaultInit, ...init };\n\n  const event = document.createEvent(constructorType);\n  const { bubbles, cancelable, ...data } = eventInit;\n  event.initEvent(type, bubbles, cancelable);\n\n  if (data != null) {\n    Object.keys(data).forEach((key) => {\n      const value = data[key];\n      // Ensure that mocks for 'preventDefault' can be called without interferring with\n      // the native behavior of 'preventDefault' (inc for passive events)\n      if (key === 'preventDefault' && typeof value === 'function') {\n        const originalPreventDefault = event.preventDefault.bind(event);\n        const preventDefault = function () {\n          // call the original function\n          originalPreventDefault();\n          // call the mock function\n          value();\n        };\n        Object.defineProperty(event, key, {\n          configurable: true,\n          value: preventDefault\n        });\n      } else if (value != null) {\n        Object.defineProperty(event, key, { configurable: true, value });\n      }\n    });\n  }\n  return event;\n}\n"
  },
  {
    "path": "packages/dom-event-testing-library/src/domEnvironment.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Change environment support for PointerEvent.\n */\n\nconst emptyFunction = function () {};\n\nexport function hasPointerEvent() {\n  return global != null && global.PointerEvent != null;\n}\n\nexport function setPointerEvent(bool) {\n  const pointerCaptureFn = (name) => (id) => {\n    if (typeof id !== 'number') {\n      if (process.env.NODE_ENV !== 'production') {\n        console.error('A pointerId must be passed to \"%s\"', name);\n      }\n    }\n  };\n  global.PointerEvent = bool ? emptyFunction : undefined;\n  global.HTMLElement.prototype.setPointerCapture = bool\n    ? pointerCaptureFn('setPointerCapture')\n    : undefined;\n  global.HTMLElement.prototype.releasePointerCapture = bool\n    ? pointerCaptureFn('releasePointerCapture')\n    : undefined;\n}\n\n/**\n * Change environment host platform.\n */\n\nconst platformGetter = jest.spyOn(global.navigator, 'platform', 'get');\n\nexport const platform = {\n  clear() {\n    platformGetter.mockClear();\n  },\n  get() {\n    return global.navigator.platform === 'MacIntel' ? 'mac' : 'windows';\n  },\n  set(name) {\n    switch (name) {\n      case 'mac': {\n        platformGetter.mockReturnValue('MacIntel');\n        break;\n      }\n      case 'windows': {\n        platformGetter.mockReturnValue('Win32');\n        break;\n      }\n      default: {\n        break;\n      }\n    }\n  }\n};\n"
  },
  {
    "path": "packages/dom-event-testing-library/src/domEventSequences.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nimport {\n  buttonType,\n  buttonsType,\n  defaultPointerId,\n  defaultPointerSize,\n  defaultBrowserChromeSize\n} from './constants';\nimport * as domEvents from './domEvents';\nimport { hasPointerEvent, platform } from './domEnvironment';\nimport * as touchStore from './touchStore';\n\n/**\n * Converts a PointerEvent payload to a Touch\n */\nfunction createTouch(target, payload) {\n  const {\n    height = defaultPointerSize,\n    pageX,\n    pageY,\n    pointerId,\n    pressure = 1,\n    twist = 0,\n    width = defaultPointerSize,\n    x = 0,\n    y = 0\n  } = payload;\n\n  return {\n    clientX: x,\n    clientY: y,\n    force: pressure,\n    identifier: pointerId,\n    pageX: pageX || x,\n    pageY: pageY || y,\n    radiusX: width / 2,\n    radiusY: height / 2,\n    rotationAngle: twist,\n    target,\n    screenX: x,\n    screenY: y + defaultBrowserChromeSize\n  };\n}\n\n/**\n * Converts a PointerEvent to a TouchEvent\n */\nfunction createTouchEventPayload(target, touch, payload) {\n  const {\n    altKey = false,\n    ctrlKey = false,\n    metaKey = false,\n    preventDefault,\n    shiftKey = false,\n    timeStamp\n  } = payload;\n\n  return {\n    altKey,\n    changedTouches: [touch],\n    ctrlKey,\n    metaKey,\n    preventDefault,\n    shiftKey,\n    targetTouches: touchStore.getTargetTouches(target),\n    timeStamp,\n    touches: touchStore.getTouches()\n  };\n}\n\nfunction getPointerType(payload) {\n  let pointerType = 'mouse';\n  if (payload != null && payload.pointerType != null) {\n    pointerType = payload.pointerType;\n  }\n  return pointerType;\n}\n\n/**\n * Pointer events sequences.\n *\n * Creates representative browser event sequences for high-level gestures based on pointers.\n * This allows unit tests to be written in terms of simple pointer interactions while testing\n * that the responses to those interactions account for the complex sequence of events that\n * browsers produce as a result.\n *\n * Every time a new pointer touches the surface a 'touchstart' event should be dispatched.\n * - 'changedTouches' contains the new touch.\n * - 'targetTouches' contains all the active pointers for the target.\n * - 'touches' contains all the active pointers on the surface.\n *\n * Every time an existing pointer moves a 'touchmove' event should be dispatched.\n * - 'changedTouches' contains the updated touch.\n *\n * Every time an existing pointer leaves the surface a 'touchend' event should be dispatched.\n * - 'changedTouches' contains the released touch.\n * - 'targetTouches' contains any of the remaining active pointers for the target.\n */\n\nexport function contextmenu(target, defaultPayload = {}) {\n  const dispatch = (arg) => target.dispatchEvent(arg);\n  const pointerType = getPointerType(defaultPayload);\n\n  const {\n    ctrlKey,\n    // eslint-disable-next-line\n    pointerType: _,\n    ...restPayload\n  } = defaultPayload;\n\n  const payload = {\n    pointerId: defaultPointerId,\n    ...restPayload,\n    button: buttonType.primary,\n    buttons: buttonsType.primary,\n    pointerType\n  };\n\n  const preventDefault = payload.preventDefault;\n\n  if (pointerType === 'touch') {\n    if (hasPointerEvent()) {\n      dispatch(domEvents.pointerdown(payload));\n    }\n    const touch = createTouch(target, payload);\n    touchStore.addTouch(touch);\n    const touchEventPayload = createTouchEventPayload(target, touch, payload);\n    dispatch(domEvents.touchstart(touchEventPayload));\n    dispatch(\n      domEvents.mousemove({\n        ...payload,\n        button: buttonType.primary,\n        buttons: buttonsType.none\n      })\n    );\n    dispatch(\n      domEvents.contextmenu({\n        ...payload,\n        button: buttonType.primary,\n        buttons: buttonsType.none,\n        preventDefault\n      })\n    );\n    touchStore.removeTouch(touch);\n  } else if (pointerType === 'mouse') {\n    if (ctrlKey === true) {\n      const { button, buttons } = payload;\n      if (hasPointerEvent()) {\n        dispatch(domEvents.pointerdown({ ...payload, ctrlKey }));\n      }\n      dispatch(domEvents.mousedown({ ...payload, ctrlKey }));\n      if (platform.get() === 'mac') {\n        dispatch(\n          domEvents.contextmenu({ button, buttons, ctrlKey, preventDefault })\n        );\n      }\n    } else {\n      const button = buttonType.secondary;\n      const buttons = buttonsType.secondary;\n      if (hasPointerEvent()) {\n        dispatch(domEvents.pointerdown({ ...payload, button, buttons }));\n      }\n      dispatch(domEvents.mousedown({ ...payload, button, buttons }));\n      dispatch(\n        domEvents.contextmenu({ ...payload, button, buttons, preventDefault })\n      );\n    }\n  }\n}\n\nexport function focus(target, defaultPayload = {}) {\n  const dispatch = (arg) => target.dispatchEvent(arg);\n  const { relatedTarget, ...payload } = defaultPayload;\n  const blurPayload = { ...payload, relatedTarget: target };\n  const focusPayload = { ...payload, relatedTarget };\n  if (relatedTarget) {\n    relatedTarget.dispatchEvent(domEvents.focusout(blurPayload));\n  }\n  dispatch(domEvents.focusin(focusPayload));\n  if (relatedTarget) {\n    relatedTarget.dispatchEvent(domEvents.blur(blurPayload));\n  }\n  dispatch(domEvents.focus(focusPayload));\n}\n\nexport function pointercancel(target, defaultPayload) {\n  const dispatchEvent = (arg) => target.dispatchEvent(arg);\n  const pointerType = getPointerType(defaultPayload);\n\n  const payload = {\n    pointerId: defaultPointerId,\n    pointerType,\n    ...defaultPayload\n  };\n\n  if (hasPointerEvent()) {\n    dispatchEvent(domEvents.pointercancel(payload));\n  }\n  if (pointerType === 'mouse') {\n    dispatchEvent(domEvents.dragstart(payload));\n  } else {\n    const touch = createTouch(target, payload);\n    touchStore.removeTouch(touch);\n    const touchEventPayload = createTouchEventPayload(target, touch, payload);\n    dispatchEvent(domEvents.touchcancel(touchEventPayload));\n  }\n}\n\nexport function pointerdown(target, defaultPayload) {\n  const dispatch = (arg) => target.dispatchEvent(arg);\n  const pointerType = getPointerType(defaultPayload);\n\n  const payload = {\n    button: buttonType.primary,\n    buttons: buttonsType.primary,\n    pointerId: defaultPointerId,\n    pointerType,\n    ...defaultPayload\n  };\n\n  if (pointerType === 'mouse') {\n    if (hasPointerEvent()) {\n      dispatch(domEvents.pointerover(payload));\n      dispatch(domEvents.pointerenter(payload));\n    }\n    dispatch(domEvents.mouseover(payload));\n    dispatch(domEvents.mouseenter(payload));\n    if (hasPointerEvent()) {\n      dispatch(domEvents.pointerdown(payload));\n    }\n    dispatch(domEvents.mousedown(payload));\n    focus(target);\n  } else {\n    if (hasPointerEvent()) {\n      dispatch(domEvents.pointerover(payload));\n      dispatch(domEvents.pointerenter(payload));\n      dispatch(domEvents.pointerdown(payload));\n    }\n    const touch = createTouch(target, payload);\n    touchStore.addTouch(touch);\n    const touchEventPayload = createTouchEventPayload(target, touch, payload);\n    dispatch(domEvents.touchstart(touchEventPayload));\n    if (hasPointerEvent()) {\n      dispatch(domEvents.gotpointercapture(payload));\n    }\n  }\n}\n\nexport function pointerover(target, defaultPayload) {\n  const dispatch = (arg) => target.dispatchEvent(arg);\n\n  const payload = {\n    pointerId: defaultPointerId,\n    ...defaultPayload\n  };\n\n  if (hasPointerEvent()) {\n    // Pointer must move before it can dispatch \"over\"\n    dispatch(domEvents.pointermove());\n    dispatch(domEvents.pointerover(payload));\n    dispatch(domEvents.pointerenter(payload));\n  }\n  dispatch(domEvents.mousemove());\n  dispatch(domEvents.mouseover(payload));\n  dispatch(domEvents.mouseenter(payload));\n}\n\nexport function pointerout(target, defaultPayload) {\n  const dispatch = (arg) => target.dispatchEvent(arg);\n\n  const payload = {\n    pointerId: defaultPointerId,\n    ...defaultPayload\n  };\n\n  const { relatedTarget } = payload;\n\n  if (hasPointerEvent()) {\n    dispatch(domEvents.pointerout(payload));\n    // Only call the leave event if exiting the subtree\n    if (!target.contains(relatedTarget)) {\n      dispatch(domEvents.pointerleave(payload));\n    }\n  }\n  dispatch(domEvents.mouseout(payload));\n  if (!target.contains(relatedTarget)) {\n    // Only call the leave event if exiting the subtree\n    dispatch(domEvents.mouseleave(payload));\n  }\n}\n\n// pointer is not down while moving\nexport function pointerhover(target, defaultPayload) {\n  const dispatch = (arg) => target.dispatchEvent(arg);\n\n  const payload = {\n    pointerId: defaultPointerId,\n    ...defaultPayload\n  };\n\n  if (hasPointerEvent()) {\n    dispatch(domEvents.pointermove(payload));\n  }\n  dispatch(domEvents.mousemove(payload));\n}\n\n// pointer is down while moving\nexport function pointermove(target, defaultPayload) {\n  const dispatch = (arg) => target.dispatchEvent(arg);\n  const pointerType = getPointerType(defaultPayload);\n\n  const payload = {\n    button: buttonType.primary,\n    buttons: buttonsType.primary,\n    pointerId: defaultPointerId,\n    pointerType,\n    ...defaultPayload\n  };\n\n  if (pointerType === 'mouse') {\n    if (hasPointerEvent()) {\n      dispatch(\n        domEvents.pointermove({ pressure: 0.5, button: -1, ...payload })\n      );\n    }\n    dispatch(domEvents.mousemove(payload));\n  } else {\n    if (hasPointerEvent()) {\n      dispatch(\n        domEvents.pointermove({\n          pressure: 1,\n          button: -1,\n          ...payload\n        })\n      );\n    }\n    const touch = createTouch(target, payload);\n    touchStore.updateTouch(touch);\n    const touchEventPayload = createTouchEventPayload(target, touch, payload);\n    dispatch(domEvents.touchmove(touchEventPayload));\n  }\n}\n\nexport function pointerup(target, defaultPayload) {\n  const dispatch = (arg) => target.dispatchEvent(arg);\n  const pointerType = getPointerType(defaultPayload);\n\n  const payload = {\n    pointerId: defaultPointerId,\n    pointerType,\n    ...defaultPayload\n  };\n\n  const isPrimaryButton = payload.button === buttonType.primary;\n  const isContextMenuAction =\n    platform.get() === 'mac' && payload.ctrlKey === true;\n\n  if (pointerType === 'mouse') {\n    if (hasPointerEvent()) {\n      dispatch(domEvents.pointerup(payload));\n    }\n    dispatch(domEvents.mouseup(payload));\n    if (isPrimaryButton && !isContextMenuAction) {\n      dispatch(domEvents.click(payload));\n    }\n  } else {\n    if (hasPointerEvent()) {\n      dispatch(domEvents.pointerup(payload));\n      dispatch(domEvents.lostpointercapture(payload));\n      dispatch(domEvents.pointerout(payload));\n      dispatch(domEvents.pointerleave(payload));\n    }\n    const touch = createTouch(target, payload);\n    const isGesture = touchStore.removeTouch(touch);\n    const touchEventPayload = createTouchEventPayload(target, touch, payload);\n    dispatch(domEvents.touchend(touchEventPayload));\n    // emulated mouse events don't occur for multi-touch or after 'touchmove'\n    if (!isGesture) {\n      dispatch(domEvents.mouseover(payload));\n      dispatch(domEvents.mousemove(payload));\n      dispatch(domEvents.mousedown(payload));\n    }\n    focus(target);\n    if (!isGesture) {\n      dispatch(domEvents.mouseup(payload));\n    }\n    if (isPrimaryButton && !isContextMenuAction) {\n      dispatch(domEvents.click(payload));\n    }\n  }\n}\n\n/**\n * This function should be called after each test to ensure the touchStore is cleared\n * in cases where the mock pointers weren't released before the test completed\n * (e.g., a test failed or ran a partial gesture).\n */\nexport function clearPointers() {\n  touchStore.clear();\n}\n"
  },
  {
    "path": "packages/dom-event-testing-library/src/domEvents.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nimport createEvent from './createEvent';\nimport {\n  buttonType,\n  buttonsType,\n  defaultPointerSize,\n  defaultBrowserChromeSize\n} from './constants';\n\n/**\n * Native event object mocks for higher-level events.\n *\n * 1. Each event type defines the exact object that it accepts. This ensures\n * that no arbitrary properties can be assigned to events, and the properties\n * that don't exist on specific event types (e.g., 'pointerType') are not added\n * to the respective native event.\n *\n * 2. Properties that cannot be relied on due to inconsistent browser support (e.g., 'x' and 'y') are not\n * added to the native event. Others that shouldn't be arbitrarily customized (e.g., 'screenX')\n * are automatically inferred from associated values.\n *\n * 3. PointerEvent and TouchEvent fields are normalized (e.g., 'rotationAngle' -> 'twist')\n */\n\nfunction emptyFunction() {}\n\nfunction createGetModifierState(keyArg, data) {\n  if (keyArg === 'Alt') {\n    return data.altKey || false;\n  }\n  if (keyArg === 'Control') {\n    return data.ctrlKey || false;\n  }\n  if (keyArg === 'Meta') {\n    return data.metaKey || false;\n  }\n  if (keyArg === 'Shift') {\n    return data.shiftKey || false;\n  }\n}\n\n/**\n * KeyboardEvent\n */\n\nfunction createKeyboardEvent(\n  type,\n  {\n    altKey = false,\n    ctrlKey = false,\n    isComposing = false,\n    key = '',\n    metaKey = false,\n    preventDefault = emptyFunction,\n    shiftKey = false\n  } = {}\n) {\n  const modifierState = { altKey, ctrlKey, metaKey, shiftKey };\n\n  const eventPayload = {\n    altKey,\n    ctrlKey,\n    getModifierState(keyArg) {\n      return createGetModifierState(keyArg, modifierState);\n    },\n    isComposing,\n    key,\n    metaKey,\n    preventDefault,\n    shiftKey\n  };\n\n  if (isComposing) {\n    eventPayload.keyCode = 229;\n  }\n\n  return createEvent(type, eventPayload);\n}\n\n/**\n * MouseEvent\n */\n\nfunction createMouseEvent(\n  type,\n  {\n    altKey = false,\n    button = buttonType.none,\n    buttons = buttonsType.none,\n    ctrlKey = false,\n    detail = 1,\n    metaKey = false,\n    movementX = 0,\n    movementY = 0,\n    offsetX = 0,\n    offsetY = 0,\n    pageX,\n    pageY,\n    preventDefault = emptyFunction,\n    relatedTarget,\n    screenX,\n    screenY,\n    shiftKey = false,\n    timeStamp,\n    x = 0,\n    y = 0\n  } = {}\n) {\n  const modifierState = { altKey, ctrlKey, metaKey, shiftKey };\n\n  return createEvent(type, {\n    altKey,\n    button,\n    buttons,\n    clientX: x,\n    clientY: y,\n    ctrlKey,\n    detail,\n    getModifierState(keyArg) {\n      return createGetModifierState(keyArg, modifierState);\n    },\n    metaKey,\n    movementX,\n    movementY,\n    offsetX,\n    offsetY,\n    pageX: pageX || x,\n    pageY: pageY || y,\n    preventDefault,\n    relatedTarget,\n    screenX: screenX === 0 ? screenX : x,\n    screenY: screenY === 0 ? screenY : y + defaultBrowserChromeSize,\n    shiftKey,\n    timeStamp\n  });\n}\n\n/**\n * PointerEvent\n */\n\nfunction createPointerEvent(\n  type,\n  {\n    altKey = false,\n    button = buttonType.none,\n    buttons = buttonsType.none,\n    ctrlKey = false,\n    detail = 1,\n    height,\n    metaKey = false,\n    movementX = 0,\n    movementY = 0,\n    offsetX = 0,\n    offsetY = 0,\n    pageX,\n    pageY,\n    pointerId,\n    pressure = 0,\n    preventDefault = emptyFunction,\n    pointerType = 'mouse',\n    relatedTarget,\n    screenX,\n    screenY,\n    shiftKey = false,\n    tangentialPressure = 0,\n    tiltX = 0,\n    tiltY = 0,\n    timeStamp,\n    twist = 0,\n    width,\n    x = 0,\n    y = 0\n  } = {}\n) {\n  const modifierState = { altKey, ctrlKey, metaKey, shiftKey };\n  const isMouse = pointerType === 'mouse';\n\n  return createEvent(type, {\n    altKey,\n    button,\n    buttons,\n    clientX: x,\n    clientY: y,\n    ctrlKey,\n    detail,\n    getModifierState(keyArg) {\n      return createGetModifierState(keyArg, modifierState);\n    },\n    height: isMouse ? 1 : height != null ? height : defaultPointerSize,\n    metaKey,\n    movementX,\n    movementY,\n    offsetX,\n    offsetY,\n    pageX: pageX || x,\n    pageY: pageY || y,\n    pointerId,\n    pointerType,\n    pressure,\n    preventDefault,\n    relatedTarget,\n    releasePointerCapture: emptyFunction,\n    screenX: screenX === 0 ? screenX : x,\n    screenY: screenY === 0 ? screenY : y + defaultBrowserChromeSize,\n    setPointerCapture: emptyFunction,\n    shiftKey,\n    tangentialPressure,\n    tiltX,\n    tiltY,\n    timeStamp,\n    twist,\n    width: isMouse ? 1 : width != null ? width : defaultPointerSize\n  });\n}\n\n/**\n * TouchEvent\n */\n\nfunction createTouchEvent(type, payload) {\n  return createEvent(type, {\n    ...payload,\n    detail: 0,\n    sourceCapabilities: {\n      firesTouchEvents: true\n    }\n  });\n}\n\n/**\n * DOM events\n */\n\nexport function blur({ relatedTarget } = {}) {\n  return createEvent('blur', { relatedTarget });\n}\n\nexport function click(payload) {\n  return createMouseEvent('click', {\n    button: buttonType.primary,\n    ...payload\n  });\n}\n\nexport function contextmenu(payload) {\n  return createMouseEvent('contextmenu', {\n    ...payload,\n    detail: 0\n  });\n}\n\nexport function dragstart(payload) {\n  return createMouseEvent('dragstart', {\n    ...payload,\n    detail: 0\n  });\n}\n\nexport function error() {\n  return createEvent('error');\n}\n\nexport function focus({ relatedTarget } = {}) {\n  return createEvent('focus', { relatedTarget });\n}\n\nexport function focusin({ relatedTarget } = {}) {\n  return createEvent('focusin', { relatedTarget });\n}\n\nexport function focusout({ relatedTarget } = {}) {\n  return createEvent('focusout', { relatedTarget });\n}\n\nexport function gotpointercapture(payload) {\n  return createPointerEvent('gotpointercapture', payload);\n}\n\nexport function keydown(payload) {\n  return createKeyboardEvent('keydown', payload);\n}\n\nexport function keyup(payload) {\n  return createKeyboardEvent('keyup', payload);\n}\n\nexport function load(payload) {\n  return createEvent('load', payload);\n}\n\nexport function lostpointercapture(payload) {\n  return createPointerEvent('lostpointercapture', payload);\n}\n\nexport function mousedown(payload) {\n  // The value of 'button' and 'buttons' for 'mousedown' must not be none.\n  const button =\n    payload != null && payload.button !== buttonType.none\n      ? payload.button\n      : buttonType.primary;\n  const buttons =\n    payload != null && payload.buttons !== buttonsType.none\n      ? payload.buttons\n      : buttonsType.primary;\n\n  return createMouseEvent('mousedown', {\n    ...payload,\n    button,\n    buttons\n  });\n}\n\nexport function mouseenter(payload) {\n  return createMouseEvent('mouseenter', payload);\n}\n\nexport function mouseleave(payload) {\n  return createMouseEvent('mouseleave', payload);\n}\n\nexport function mousemove(payload) {\n  return createMouseEvent('mousemove', {\n    // 0 is also the uninitialized value (i.e., don't assume it means primary button down)\n    button: 0,\n    buttons: 0,\n    ...payload\n  });\n}\n\nexport function mouseout(payload) {\n  return createMouseEvent('mouseout', payload);\n}\n\nexport function mouseover(payload) {\n  return createMouseEvent('mouseover', payload);\n}\n\nexport function mouseup(payload) {\n  return createMouseEvent('mouseup', {\n    button: buttonType.primary,\n    ...payload,\n    buttons: buttonsType.none\n  });\n}\nexport function pointercancel(payload) {\n  return createPointerEvent('pointercancel', {\n    ...payload,\n    buttons: 0,\n    detail: 0,\n    height: 1,\n    pageX: 0,\n    pageY: 0,\n    pressure: 0,\n    screenX: 0,\n    screenY: 0,\n    width: 1,\n    x: 0,\n    y: 0\n  });\n}\n\nexport function pointerdown(payload) {\n  const isTouch = payload != null && payload.pointerType === 'touch';\n  return createPointerEvent('pointerdown', {\n    button: buttonType.primary,\n    buttons: buttonsType.primary,\n    pressure: isTouch ? 1 : 0.5,\n    ...payload\n  });\n}\n\nexport function pointerenter(payload) {\n  return createPointerEvent('pointerenter', payload);\n}\n\nexport function pointerleave(payload) {\n  return createPointerEvent('pointerleave', payload);\n}\n\nexport function pointermove(payload) {\n  return createPointerEvent('pointermove', {\n    ...payload,\n    button: buttonType.none,\n    buttons: buttonsType.none\n  });\n}\n\nexport function pointerout(payload) {\n  return createPointerEvent('pointerout', payload);\n}\n\nexport function pointerover(payload) {\n  return createPointerEvent('pointerover', payload);\n}\n\nexport function pointerup(payload) {\n  return createPointerEvent('pointerup', {\n    button: buttonType.primary,\n    ...payload,\n    buttons: buttonsType.none,\n    pressure: 0\n  });\n}\n\nexport function scroll() {\n  return createEvent('scroll', { bubbles: false });\n}\n\nexport function select() {\n  return createEvent('select');\n}\n\nexport function selectionchange() {\n  return createEvent('selectionchange');\n}\n\nexport function touchcancel(payload) {\n  return createTouchEvent('touchcancel', payload);\n}\n\nexport function touchend(payload) {\n  return createTouchEvent('touchend', payload);\n}\n\nexport function touchmove(payload) {\n  return createTouchEvent('touchmove', payload);\n}\n\nexport function touchstart(payload) {\n  return createTouchEvent('touchstart', payload);\n}\n\nexport function virtualclick(payload) {\n  return createMouseEvent('click', {\n    button: 0,\n    ...payload,\n    buttons: 0,\n    detail: 0,\n    height: 1,\n    pageX: 0,\n    pageY: 0,\n    pressure: 0,\n    screenX: 0,\n    screenY: 0,\n    width: 1,\n    x: 0,\n    y: 0\n  });\n}\n"
  },
  {
    "path": "packages/dom-event-testing-library/src/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nimport { buttonType, buttonsType } from './constants';\nimport * as domEvents from './domEvents';\nimport * as domEventSequences from './domEventSequences';\nimport { hasPointerEvent, setPointerEvent, platform } from './domEnvironment';\nimport { describeWithPointerEvent, testWithPointerType } from './testHelpers';\n\nconst createEventTarget = (node) => ({\n  node,\n  /**\n   * Simple events abstraction.\n   */\n  blur(payload) {\n    node.dispatchEvent(domEvents.blur(payload));\n  },\n  click(payload) {\n    node.dispatchEvent(domEvents.click(payload));\n  },\n  contextmenu(payload) {\n    domEventSequences.contextmenu(node, payload);\n  },\n  error() {\n    node.dispatchEvent(domEvents.error());\n  },\n  focus(payload) {\n    domEventSequences.focus(node, payload);\n  },\n  keydown(payload) {\n    node.dispatchEvent(domEvents.keydown(payload));\n  },\n  keyup(payload) {\n    node.dispatchEvent(domEvents.keyup(payload));\n  },\n  load(payload) {\n    node.dispatchEvent(domEvents.load(payload));\n  },\n  /**\n   * PointerEvent abstraction.\n   * Dispatches the expected sequence of PointerEvents, MouseEvents, and\n   * TouchEvents for a given environment.\n   */\n  // node no longer receives events for the pointer\n  pointercancel(payload) {\n    domEventSequences.pointercancel(node, payload);\n  },\n  // node dispatches down events\n  pointerdown(payload) {\n    domEventSequences.pointerdown(node, payload);\n  },\n  // node dispatches move events (pointer is not down)\n  pointerhover(payload) {\n    domEventSequences.pointerhover(node, payload);\n  },\n  // node dispatches move events (pointer is down)\n  pointermove(payload) {\n    domEventSequences.pointermove(node, payload);\n  },\n  // node dispatches enter & over events\n  pointerover(payload) {\n    domEventSequences.pointerover(node, payload);\n  },\n  // node dispatches exit & leave events\n  pointerout(payload) {\n    domEventSequences.pointerout(node, payload);\n  },\n  // node dispatches up events\n  pointerup(payload) {\n    domEventSequences.pointerup(node, payload);\n  },\n  scroll(payload) {\n    node.dispatchEvent(domEvents.scroll(payload));\n  },\n  select(payload) {\n    node.dispatchEvent(domEvents.select(payload));\n  },\n  // selectionchange is only dispatched on 'document'\n  selectionchange(payload) {\n    document.dispatchEvent(domEvents.selectionchange(payload));\n  },\n  /**\n   * Gesture abstractions.\n   * Helpers for event sequences expected in a gesture.\n   * target.tap({ pointerType: 'touch' })\n   */\n  tap(payload) {\n    domEventSequences.pointerdown(payload);\n    domEventSequences.pointerup(payload);\n  },\n  virtualclick(payload) {\n    node.dispatchEvent(domEvents.virtualclick(payload));\n  },\n  /**\n   * Utilities\n   */\n  setBoundingClientRect({ x, y, width, height }) {\n    node.getBoundingClientRect = function () {\n      return {\n        width,\n        height,\n        left: x,\n        right: x + width,\n        top: y,\n        bottom: y + height,\n        x,\n        y\n      };\n    };\n  }\n});\n\nconst clearPointers = domEventSequences.clearPointers;\n\nexport {\n  buttonType,\n  buttonsType,\n  clearPointers,\n  createEventTarget,\n  describeWithPointerEvent,\n  platform,\n  hasPointerEvent,\n  setPointerEvent,\n  testWithPointerType\n};\n"
  },
  {
    "path": "packages/dom-event-testing-library/src/testHelpers.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nimport { hasPointerEvent, setPointerEvent } from './domEnvironment';\n\nexport function describeWithPointerEvent(message, describeFn) {\n  const pointerEvent = 'PointerEvent';\n  const fallback = 'MouseEvent/TouchEvent';\n  describe.each`\n    value    | name\n    ${true}  | ${pointerEvent}\n    ${false} | ${fallback}\n  `(`${message}: $name`, (entry) => {\n    const hasPointerEvents = entry.value;\n    setPointerEvent(hasPointerEvents);\n    describeFn(hasPointerEvents);\n  });\n}\n\nexport function testWithPointerType(message, testFn) {\n  const table = hasPointerEvent()\n    ? ['mouse', 'touch', 'pen']\n    : ['mouse', 'touch'];\n  test.each(table)(`${message}: %s`, (pointerType) => {\n    testFn(pointerType);\n  });\n}\n"
  },
  {
    "path": "packages/dom-event-testing-library/src/touchStore.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Touch events state machine.\n *\n * Keeps track of the active pointers and allows them to be reflected in touch events.\n */\n\nlet isGesture = false;\nconst activeTouches = new Map();\n\nexport function addTouch(touch) {\n  const identifier = touch.identifier;\n  const target = touch.target;\n  if (!activeTouches.has(target)) {\n    activeTouches.set(target, new Map());\n  }\n  if (activeTouches.get(target).get(identifier)) {\n    // Do not allow existing touches to be overwritten\n    console.error(\n      'Touch with identifier %s already exists. Did not record touch start.',\n      identifier\n    );\n  } else {\n    activeTouches.get(target).set(identifier, touch);\n  }\n  isGesture = activeTouches.size > 1;\n}\n\nexport function updateTouch(touch) {\n  const identifier = touch.identifier;\n  const target = touch.target;\n  if (activeTouches.get(target) != null) {\n    activeTouches.get(target).set(identifier, touch);\n    isGesture = true;\n  } else {\n    console.error(\n      'Touch with identifier %s does not exist. Cannot record touch move without a touch start.',\n      identifier\n    );\n  }\n}\n\nexport function removeTouch(touch) {\n  const identifier = touch.identifier;\n  const target = touch.target;\n  if (activeTouches.get(target) != null) {\n    if (activeTouches.get(target).has(identifier)) {\n      activeTouches.get(target).delete(identifier);\n    } else {\n      console.error(\n        'Touch with identifier %s does not exist. Cannot record touch end without a touch start.',\n        identifier\n      );\n    }\n  }\n  return isGesture;\n}\n\nexport function getTouches() {\n  const touches = [];\n  activeTouches.forEach((_, target) => {\n    touches.push(...getTargetTouches(target));\n  });\n  return touches;\n}\n\nexport function getTargetTouches(target) {\n  if (activeTouches.get(target) != null) {\n    return Array.from(activeTouches.get(target).values());\n  }\n  return [];\n}\n\nexport function clear() {\n  activeTouches.clear();\n}\n"
  },
  {
    "path": "packages/react-native-web/LICENSE",
    "content": "MIT License\n\nCopyright (c) Nicolas Gallagher.\nCopyright (c) Meta Platforms, Inc. and affiliates.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "packages/react-native-web/README.md",
    "content": "# React Native for Web\n\n[![npm version][package-badge]][package-url] [![Build Status][ci-badge]][ci-url] [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://reactjs.org/docs/how-to-contribute.html#your-first-pull-request)\n\n\"React Native for Web\" makes it possible to run [React Native][react-native-url] components and APIs on the web using React DOM.\n\n## Documentation\n\nThe [documentation site](https://necolas.github.io/react-native-web/) ([source](https://github.com/necolas/react-native-web/blob/master/packages/react-native-web-docs)) covers installation, guides, and APIs.\n\n## Example\n\nThe [examples app](https://p9t5cp.sse.codesandbox.io/) ([source](https://github.com/necolas/react-native-web/blob/master/packages/react-native-web-examples)) demonstrates many available features. Fork the [codesandbox](https://codesandbox.io/s/github/necolas/react-native-web/tree/master/packages/react-native-web-examples) to make changes and see the results.\n\nYou'll notice that there is no reference to `react-dom` in components. The `App` component that is shown below is defined using the APIs and Components of React Native, but it can also be rendered on the web using React Native for Web.\n\n```js\n// Example component\nimport React from 'react';\nimport { AppRegistry, StyleSheet, Text, View } from 'react-native';\n\nclass App extends React.Component {\n  render() {\n    return (\n      <View style={styles.box}>\n        <Text style={styles.text}>Hello, world!</Text>\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  box: { padding: 10 },\n  text: { fontWeight: 'bold' }\n});\n\nAppRegistry.registerComponent('App', () => App);\nAppRegistry.runApplication('App', { rootTag: document.getElementById('react-root') });\n```\n\n## Contributing\n\nDevelopment happens in the open on GitHub and we are grateful for contributions including bugfixes, improvements, and ideas. Read below to learn how you can take part in improving React Native for Web.\n\n### Code of conduct\n\nThis project expects all participants to adhere to Meta's OSS [Code of Conduct][code-of-conduct]. Please read the full text so that you can understand what actions will and will not be tolerated.\n\n### Contributing guide\n\nRead the [contributing guide][contributing-url] to learn about the development process, how to propose bugfixes and improvements, and how to build and test your changes to React Native for Web.\n\n### Good first issues\n\nTo help you get you familiar with the contribution process, there is a list of [good first issues][good-first-issue-url] that contain bugs which have a relatively limited scope. This is a great place to get started.\n\n## License\n\nReact Native for Web is [MIT licensed](./LICENSE). By contributing to React Native for Web, you agree that your contributions will be licensed under its MIT license.\n\n[package-badge]: https://img.shields.io/npm/v/react-native-web.svg?style=flat\n[package-url]: https://www.npmjs.com/package/react-native-web\n[ci-badge]: https://github.com/necolas/react-native-web/workflows/tests/badge.svg\n[ci-url]: https://github.com/necolas/react-native-web/actions\n[react-native-url]: https://reactnative.dev/\n[contributing-url]: https://github.com/necolas/react-native-web/blob/master/.github/CONTRIBUTING.md\n[good-first-issue-url]: https://github.com/necolas/react-native-web/labels/good%20first%20issue\n[code-of-conduct]: https://opensource.fb.com/code-of-conduct/\n"
  },
  {
    "path": "packages/react-native-web/package.json",
    "content": "{\n  \"publishConfig\": {\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"name\": \"react-native-web\",\n  \"version\": \"0.21.2\",\n  \"description\": \"React Native for Web\",\n  \"module\": \"dist/index.js\",\n  \"main\": \"dist/cjs/index.js\",\n  \"sideEffects\": false,\n  \"files\": [\n    \"dist\",\n    \"src\",\n    \"!**/__tests__\"\n  ],\n  \"scripts\": {\n    \"clean\": \"del-cli ./dist\",\n    \"build\": \"npm-run-all clean -p \\\"build:* {@}\\\" --\",\n    \"build:commonjs\": \"cross-env BABEL_ENV=commonjs babel src --config-file ../../configs/babel.config.js --out-dir dist/cjs --ignore \\\"**/__tests__\\\"\",\n    \"build:es\": \"babel src --config-file ../../configs/babel.config.js --out-dir dist --ignore \\\"**/__tests__\\\"\",\n    \"build:flow\": \"gen-flow-files ./src --out-dir ./dist\",\n    \"dev\": \"npm-run-all clean -p \\\"build:* {@} -- --watch\\\"\"\n  },\n  \"dependencies\": {\n    \"@babel/runtime\": \"^7.18.6\",\n    \"@react-native/normalize-colors\": \"^0.74.1\",\n    \"fbjs\": \"^3.0.4\",\n    \"inline-style-prefixer\": \"^7.0.1\",\n    \"memoize-one\": \"^6.0.0\",\n    \"nullthrows\": \"^1.1.1\",\n    \"postcss-value-parser\": \"^4.2.0\",\n    \"styleq\": \"^0.1.3\"\n  },\n  \"peerDependencies\": {\n    \"react\": \"^18.0.0 || ^19.0.0\",\n    \"react-dom\": \"^18.0.0 || ^19.0.0\"\n  },\n  \"author\": \"Nicolas Gallagher\",\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/necolas/react-native-web.git\"\n  },\n  \"tags\": [\n    \"react\"\n  ],\n  \"keywords\": [\n    \"react\",\n    \"react-component\",\n    \"react-native\",\n    \"web\"\n  ]\n}\n"
  },
  {
    "path": "packages/react-native-web/src/exports/AccessibilityInfo/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use client';\n\nimport canUseDOM from '../../modules/canUseDom';\n\nfunction isScreenReaderEnabled(): Promise<*> {\n  return new Promise((resolve, reject) => {\n    resolve(true);\n  });\n}\n\nconst prefersReducedMotionMedia =\n  canUseDOM && typeof window.matchMedia === 'function'\n    ? window.matchMedia('(prefers-reduced-motion: reduce)')\n    : null;\n\nfunction isReduceMotionEnabled(): Promise<*> {\n  return new Promise((resolve, reject) => {\n    resolve(\n      prefersReducedMotionMedia ? prefersReducedMotionMedia.matches : true\n    );\n  });\n}\n\nfunction addChangeListener(fn) {\n  if (prefersReducedMotionMedia != null) {\n    prefersReducedMotionMedia.addEventListener != null\n      ? prefersReducedMotionMedia.addEventListener('change', fn)\n      : prefersReducedMotionMedia.addListener(fn);\n  }\n}\n\nfunction removeChangeListener(fn) {\n  if (prefersReducedMotionMedia != null) {\n    prefersReducedMotionMedia.removeEventListener != null\n      ? prefersReducedMotionMedia.removeEventListener('change', fn)\n      : prefersReducedMotionMedia.removeListener(fn);\n  }\n}\n\nconst handlers = {};\n\nconst AccessibilityInfo = {\n  /**\n   * Query whether a screen reader is currently enabled.\n   *\n   * Returns a promise which resolves to a boolean.\n   * The result is `true` when a screen reader is enabled and `false` otherwise.\n   */\n  isScreenReaderEnabled,\n\n  /**\n   * Query whether the user prefers reduced motion.\n   *\n   * Returns a promise which resolves to a boolean.\n   * The result is `true` when a screen reader is enabled and `false` otherwise.\n   */\n  isReduceMotionEnabled,\n\n  /**\n   * Deprecated\n   */\n  fetch: isScreenReaderEnabled,\n\n  /**\n   * Add an event handler. Supported events: reduceMotionChanged\n   */\n  addEventListener: function (eventName: string, handler: Function): Object {\n    if (eventName === 'reduceMotionChanged') {\n      if (!prefersReducedMotionMedia) {\n        return;\n      }\n      const listener = (event) => {\n        handler(event.matches);\n      };\n      addChangeListener(listener);\n      handlers[handler] = listener;\n    }\n\n    return {\n      remove: () => AccessibilityInfo.removeEventListener(eventName, handler)\n    };\n  },\n\n  /**\n   * Set accessibility focus to a react component.\n   */\n  setAccessibilityFocus: function (reactTag: number): void {},\n\n  /**\n   * Post a string to be announced by the screen reader.\n   */\n  announceForAccessibility: function (announcement: string): void {},\n\n  /**\n   * Remove an event handler.\n   */\n  removeEventListener: function (eventName: string, handler: Function): void {\n    if (eventName === 'reduceMotionChanged') {\n      const listener = handlers[handler];\n      if (!listener || !prefersReducedMotionMedia) {\n        return;\n      }\n      removeChangeListener(listener);\n    }\n    return;\n  }\n};\n\nexport default AccessibilityInfo;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/ActivityIndicator/__tests__/__snapshots__/index-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`components/ActivityIndicator prop \"accessibilityLabel\" value is set 1`] = `\n<div\n  aria-label=\"accessibility label\"\n  aria-valuemax=\"1\"\n  aria-valuemin=\"0\"\n  class=\"css-view-g5y9jx r-alignItems-1awozwy r-justifyContent-1777fci\"\n  role=\"progressbar\"\n>\n  <div\n    class=\"css-view-g5y9jx r-height-z80fyv r-width-19wmn03 r-animationDuration-17bb2tj r-animationIterationCount-1muvv40 r-animationKeyframes-1yef0xd r-animationTimingFunction-1ldzwu0\"\n  >\n    <svg\n      height=\"100%\"\n      viewBox=\"0 0 32 32\"\n      width=\"100%\"\n    >\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; opacity: 0.2;\"\n      />\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; stroke-dasharray: 80; stroke-dashoffset: 60;\"\n      />\n    </svg>\n  </div>\n</div>\n`;\n\nexports[`components/ActivityIndicator prop \"accessibilityLiveRegion\" value is set 1`] = `\n<div\n  aria-live=\"polite\"\n  aria-valuemax=\"1\"\n  aria-valuemin=\"0\"\n  class=\"css-view-g5y9jx r-alignItems-1awozwy r-justifyContent-1777fci\"\n  role=\"progressbar\"\n>\n  <div\n    class=\"css-view-g5y9jx r-height-z80fyv r-width-19wmn03 r-animationDuration-17bb2tj r-animationIterationCount-1muvv40 r-animationKeyframes-1yef0xd r-animationTimingFunction-1ldzwu0\"\n  >\n    <svg\n      height=\"100%\"\n      viewBox=\"0 0 32 32\"\n      width=\"100%\"\n    >\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; opacity: 0.2;\"\n      />\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; stroke-dasharray: 80; stroke-dashoffset: 60;\"\n      />\n    </svg>\n  </div>\n</div>\n`;\n\nexports[`components/ActivityIndicator prop \"animating\" is \"false\" 1`] = `\n<div\n  aria-valuemax=\"1\"\n  aria-valuemin=\"0\"\n  class=\"css-view-g5y9jx r-alignItems-1awozwy r-justifyContent-1777fci\"\n  role=\"progressbar\"\n>\n  <div\n    class=\"css-view-g5y9jx r-height-z80fyv r-width-19wmn03 r-animationDuration-17bb2tj r-animationIterationCount-1muvv40 r-animationKeyframes-1yef0xd r-animationTimingFunction-1ldzwu0 r-animationPlayState-1abnn5w r-visibility-11j9u27\"\n  >\n    <svg\n      height=\"100%\"\n      viewBox=\"0 0 32 32\"\n      width=\"100%\"\n    >\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; opacity: 0.2;\"\n      />\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; stroke-dasharray: 80; stroke-dashoffset: 60;\"\n      />\n    </svg>\n  </div>\n</div>\n`;\n\nexports[`components/ActivityIndicator prop \"animating\" is \"true\" 1`] = `\n<div\n  aria-valuemax=\"1\"\n  aria-valuemin=\"0\"\n  class=\"css-view-g5y9jx r-alignItems-1awozwy r-justifyContent-1777fci\"\n  role=\"progressbar\"\n>\n  <div\n    class=\"css-view-g5y9jx r-height-z80fyv r-width-19wmn03 r-animationDuration-17bb2tj r-animationIterationCount-1muvv40 r-animationKeyframes-1yef0xd r-animationTimingFunction-1ldzwu0\"\n  >\n    <svg\n      height=\"100%\"\n      viewBox=\"0 0 32 32\"\n      width=\"100%\"\n    >\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; opacity: 0.2;\"\n      />\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; stroke-dasharray: 80; stroke-dashoffset: 60;\"\n      />\n    </svg>\n  </div>\n</div>\n`;\n\nexports[`components/ActivityIndicator prop \"color\" 1`] = `\n<svg\n  height=\"100%\"\n  viewBox=\"0 0 32 32\"\n  width=\"100%\"\n>\n  <circle\n    cx=\"16\"\n    cy=\"16\"\n    fill=\"none\"\n    r=\"14\"\n    stroke-width=\"4\"\n    style=\"stroke: red; opacity: 0.2;\"\n  />\n  <circle\n    cx=\"16\"\n    cy=\"16\"\n    fill=\"none\"\n    r=\"14\"\n    stroke-width=\"4\"\n    style=\"stroke: red; stroke-dasharray: 80; stroke-dashoffset: 60;\"\n  />\n</svg>\n`;\n\nexports[`components/ActivityIndicator prop \"dataSet\" value is set 1`] = `\n<div\n  aria-valuemax=\"1\"\n  aria-valuemin=\"0\"\n  class=\"css-view-g5y9jx r-alignItems-1awozwy r-justifyContent-1777fci\"\n  data-one=\"one\"\n  data-two=\"two\"\n  role=\"progressbar\"\n>\n  <div\n    class=\"css-view-g5y9jx r-height-z80fyv r-width-19wmn03 r-animationDuration-17bb2tj r-animationIterationCount-1muvv40 r-animationKeyframes-1yef0xd r-animationTimingFunction-1ldzwu0\"\n  >\n    <svg\n      height=\"100%\"\n      viewBox=\"0 0 32 32\"\n      width=\"100%\"\n    >\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; opacity: 0.2;\"\n      />\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; stroke-dasharray: 80; stroke-dashoffset: 60;\"\n      />\n    </svg>\n  </div>\n</div>\n`;\n\nexports[`components/ActivityIndicator prop \"hidesWhenStopped\" is \"false\" 1`] = `\n<div\n  aria-valuemax=\"1\"\n  aria-valuemin=\"0\"\n  class=\"css-view-g5y9jx r-alignItems-1awozwy r-justifyContent-1777fci\"\n  role=\"progressbar\"\n>\n  <div\n    class=\"css-view-g5y9jx r-height-z80fyv r-width-19wmn03 r-animationDuration-17bb2tj r-animationIterationCount-1muvv40 r-animationKeyframes-1yef0xd r-animationTimingFunction-1ldzwu0 r-animationPlayState-1abnn5w\"\n  >\n    <svg\n      height=\"100%\"\n      viewBox=\"0 0 32 32\"\n      width=\"100%\"\n    >\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; opacity: 0.2;\"\n      />\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; stroke-dasharray: 80; stroke-dashoffset: 60;\"\n      />\n    </svg>\n  </div>\n</div>\n`;\n\nexports[`components/ActivityIndicator prop \"hidesWhenStopped\" is \"true\" 1`] = `\n<div\n  aria-valuemax=\"1\"\n  aria-valuemin=\"0\"\n  class=\"css-view-g5y9jx r-alignItems-1awozwy r-justifyContent-1777fci\"\n  role=\"progressbar\"\n>\n  <div\n    class=\"css-view-g5y9jx r-height-z80fyv r-width-19wmn03 r-animationDuration-17bb2tj r-animationIterationCount-1muvv40 r-animationKeyframes-1yef0xd r-animationTimingFunction-1ldzwu0 r-animationPlayState-1abnn5w r-visibility-11j9u27\"\n  >\n    <svg\n      height=\"100%\"\n      viewBox=\"0 0 32 32\"\n      width=\"100%\"\n    >\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; opacity: 0.2;\"\n      />\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; stroke-dasharray: 80; stroke-dashoffset: 60;\"\n      />\n    </svg>\n  </div>\n</div>\n`;\n\nexports[`components/ActivityIndicator prop \"nativeID\" value is set 1`] = `\n<div\n  aria-valuemax=\"1\"\n  aria-valuemin=\"0\"\n  class=\"css-view-g5y9jx r-alignItems-1awozwy r-justifyContent-1777fci\"\n  id=\"123\"\n  role=\"progressbar\"\n>\n  <div\n    class=\"css-view-g5y9jx r-height-z80fyv r-width-19wmn03 r-animationDuration-17bb2tj r-animationIterationCount-1muvv40 r-animationKeyframes-1yef0xd r-animationTimingFunction-1ldzwu0\"\n  >\n    <svg\n      height=\"100%\"\n      viewBox=\"0 0 32 32\"\n      width=\"100%\"\n    >\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; opacity: 0.2;\"\n      />\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; stroke-dasharray: 80; stroke-dashoffset: 60;\"\n      />\n    </svg>\n  </div>\n</div>\n`;\n\nexports[`components/ActivityIndicator prop \"size\" is \"large\" 1`] = `\n<div\n  aria-valuemax=\"1\"\n  aria-valuemin=\"0\"\n  class=\"css-view-g5y9jx r-alignItems-1awozwy r-justifyContent-1777fci\"\n  role=\"progressbar\"\n>\n  <div\n    class=\"css-view-g5y9jx r-height-1r8g8re r-width-1acpoxo r-animationDuration-17bb2tj r-animationIterationCount-1muvv40 r-animationKeyframes-1yef0xd r-animationTimingFunction-1ldzwu0\"\n  >\n    <svg\n      height=\"100%\"\n      viewBox=\"0 0 32 32\"\n      width=\"100%\"\n    >\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; opacity: 0.2;\"\n      />\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; stroke-dasharray: 80; stroke-dashoffset: 60;\"\n      />\n    </svg>\n  </div>\n</div>\n`;\n\nexports[`components/ActivityIndicator prop \"size\" is a number 1`] = `\n<div\n  aria-valuemax=\"1\"\n  aria-valuemin=\"0\"\n  class=\"css-view-g5y9jx r-alignItems-1awozwy r-justifyContent-1777fci\"\n  role=\"progressbar\"\n>\n  <div\n    class=\"css-view-g5y9jx r-animationDuration-17bb2tj r-animationIterationCount-1muvv40 r-animationKeyframes-1yef0xd r-animationTimingFunction-1ldzwu0\"\n    style=\"height: 30px; width: 30px;\"\n  >\n    <svg\n      height=\"100%\"\n      viewBox=\"0 0 32 32\"\n      width=\"100%\"\n    >\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; opacity: 0.2;\"\n      />\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; stroke-dasharray: 80; stroke-dashoffset: 60;\"\n      />\n    </svg>\n  </div>\n</div>\n`;\n\nexports[`components/ActivityIndicator prop \"style\" value is set 1`] = `\n<div\n  aria-valuemax=\"1\"\n  aria-valuemin=\"0\"\n  class=\"css-view-g5y9jx r-alignItems-1awozwy r-justifyContent-1777fci\"\n  role=\"progressbar\"\n  style=\"border-top-width: 5px; border-right-width: 5px; border-bottom-width: 5px; border-left-width: 5px;\"\n>\n  <div\n    class=\"css-view-g5y9jx r-height-z80fyv r-width-19wmn03 r-animationDuration-17bb2tj r-animationIterationCount-1muvv40 r-animationKeyframes-1yef0xd r-animationTimingFunction-1ldzwu0\"\n  >\n    <svg\n      height=\"100%\"\n      viewBox=\"0 0 32 32\"\n      width=\"100%\"\n    >\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; opacity: 0.2;\"\n      />\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; stroke-dasharray: 80; stroke-dashoffset: 60;\"\n      />\n    </svg>\n  </div>\n</div>\n`;\n\nexports[`components/ActivityIndicator prop \"testID\" value is set 1`] = `\n<div\n  aria-valuemax=\"1\"\n  aria-valuemin=\"0\"\n  class=\"css-view-g5y9jx r-alignItems-1awozwy r-justifyContent-1777fci\"\n  data-testid=\"123\"\n  role=\"progressbar\"\n>\n  <div\n    class=\"css-view-g5y9jx r-height-z80fyv r-width-19wmn03 r-animationDuration-17bb2tj r-animationIterationCount-1muvv40 r-animationKeyframes-1yef0xd r-animationTimingFunction-1ldzwu0\"\n  >\n    <svg\n      height=\"100%\"\n      viewBox=\"0 0 32 32\"\n      width=\"100%\"\n    >\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; opacity: 0.2;\"\n      />\n      <circle\n        cx=\"16\"\n        cy=\"16\"\n        fill=\"none\"\n        r=\"14\"\n        stroke-width=\"4\"\n        style=\"stroke: #1976D2; stroke-dasharray: 80; stroke-dashoffset: 60;\"\n      />\n    </svg>\n  </div>\n</div>\n`;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/ActivityIndicator/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport ActivityIndicator from '..';\nimport React from 'react';\nimport { createEventTarget } from 'dom-event-testing-library';\nimport { act, render } from '@testing-library/react';\n\ndescribe('components/ActivityIndicator', () => {\n  describe('prop \"accessibilityLabel\"', () => {\n    test('value is set', () => {\n      const { container } = render(\n        <ActivityIndicator accessibilityLabel=\"accessibility label\" />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"accessibilityLiveRegion\"', () => {\n    test('value is set', () => {\n      const { container } = render(\n        <ActivityIndicator accessibilityLiveRegion=\"polite\" />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"animating\"', () => {\n    test('is \"true\"', () => {\n      const { container } = render(<ActivityIndicator animating={true} />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('is \"false\"', () => {\n      const { container } = render(<ActivityIndicator animating={false} />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  test('prop \"color\"', () => {\n    const { container } = render(<ActivityIndicator color=\"red\" />);\n    const svg = container.firstChild.querySelector('svg');\n    expect(svg).toMatchSnapshot();\n  });\n\n  describe('prop \"dataSet\"', () => {\n    test('value is set', () => {\n      const { container } = render(\n        <ActivityIndicator dataSet={{ one: 'one', two: 'two' }} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"hidesWhenStopped\"', () => {\n    test('is \"true\"', () => {\n      const { container } = render(\n        <ActivityIndicator animating={false} hidesWhenStopped={true} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('is \"false\"', () => {\n      const { container } = render(\n        <ActivityIndicator animating={false} hidesWhenStopped={false} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"nativeID\"', () => {\n    test('value is set', () => {\n      const { container } = render(<ActivityIndicator nativeID=\"123\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"onBlur\"', () => {\n    test('is called', () => {\n      const onBlur = jest.fn();\n      const ref = React.createRef();\n      act(() => {\n        render(<ActivityIndicator onBlur={onBlur} ref={ref} />);\n      });\n      const target = createEventTarget(ref.current);\n      const body = createEventTarget(document.body);\n      act(() => {\n        target.focus();\n        body.focus({ relatedTarget: target.node });\n      });\n      expect(onBlur).toBeCalled();\n    });\n  });\n\n  describe('prop \"onFocus\"', () => {\n    test('is called', () => {\n      const onFocus = jest.fn();\n      const ref = React.createRef();\n      act(() => {\n        render(<ActivityIndicator onFocus={onFocus} ref={ref} />);\n      });\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.focus();\n      });\n      expect(onFocus).toBeCalled();\n    });\n  });\n\n  describe('prop \"ref\"', () => {\n    test('value is set', () => {\n      const ref = jest.fn();\n      render(<ActivityIndicator ref={ref} />);\n      expect(ref).toBeCalled();\n    });\n  });\n\n  describe('prop \"size\"', () => {\n    test('is \"large\"', () => {\n      const { container } = render(<ActivityIndicator size=\"large\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('is a number', () => {\n      const { container } = render(<ActivityIndicator size={30} />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"style\"', () => {\n    test('value is set', () => {\n      const { container } = render(\n        <ActivityIndicator style={{ borderWidth: 5 }} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"testID\"', () => {\n    test('value is set', () => {\n      const { container } = render(<ActivityIndicator testID=\"123\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/ActivityIndicator/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use client';\n\nimport type { ViewProps } from '../View';\n\nimport * as React from 'react';\nimport StyleSheet from '../StyleSheet';\nimport View from '../View';\n\nconst createSvgCircle = (style) => (\n  <circle cx=\"16\" cy=\"16\" fill=\"none\" r=\"14\" strokeWidth=\"4\" style={style} />\n);\n\ntype ActivityIndicatorProps = {\n  ...ViewProps,\n  animating?: boolean,\n  color?: ?string,\n  hidesWhenStopped?: boolean,\n  size?: 'small' | 'large' | number\n};\n\nconst ActivityIndicator: React.AbstractComponent<\n  ActivityIndicatorProps,\n  React.ElementRef<typeof View>\n> = React.forwardRef((props, forwardedRef) => {\n  const {\n    animating = true,\n    color = '#1976D2',\n    hidesWhenStopped = true,\n    size = 'small',\n    style,\n    ...other\n  } = props;\n\n  const svg = (\n    <svg height=\"100%\" viewBox=\"0 0 32 32\" width=\"100%\">\n      {createSvgCircle({\n        stroke: color,\n        opacity: 0.2\n      })}\n      {createSvgCircle({\n        stroke: color,\n        strokeDasharray: 80,\n        strokeDashoffset: 60\n      })}\n    </svg>\n  );\n\n  return (\n    <View\n      {...other}\n      aria-valuemax={1}\n      aria-valuemin={0}\n      ref={forwardedRef}\n      role=\"progressbar\"\n      style={[styles.container, style]}\n    >\n      <View\n        children={svg}\n        style={[\n          typeof size === 'number'\n            ? { height: size, width: size }\n            : indicatorSizes[size],\n          styles.animation,\n          !animating && styles.animationPause,\n          !animating && hidesWhenStopped && styles.hidesWhenStopped\n        ]}\n      />\n    </View>\n  );\n});\n\nActivityIndicator.displayName = 'ActivityIndicator';\n\nconst styles = StyleSheet.create({\n  container: {\n    alignItems: 'center',\n    justifyContent: 'center'\n  },\n  hidesWhenStopped: {\n    visibility: 'hidden'\n  },\n  animation: {\n    animationDuration: '0.75s',\n    animationKeyframes: [\n      {\n        '0%': { transform: 'rotate(0deg)' },\n        '100%': { transform: 'rotate(360deg)' }\n      }\n    ],\n    animationTimingFunction: 'linear',\n    animationIterationCount: 'infinite'\n  },\n  animationPause: {\n    animationPlayState: 'paused'\n  }\n});\n\nconst indicatorSizes = StyleSheet.create({\n  small: {\n    width: 20,\n    height: 20\n  },\n  large: {\n    width: 36,\n    height: 36\n  }\n});\n\nexport default ActivityIndicator;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Alert/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nclass Alert {\n  static alert() {}\n}\n\nexport default Alert;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Animated/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nimport Animated from '..';\nimport Easing from '../../Easing';\nimport AnimatedImplementation from '../../../vendor/react-native/Animated/AnimatedImplementation';\n\nconst AnimatedInterpolation = Animated.Interpolation;\n\ndescribe('Animated', () => {\n  describe('Interpolation', () => {\n    describe('color value', () => {\n      test.each([[['#1E1E1E', '#1E1E1F']], [[0x1e1e1e, 0x1e1e1f]]])(\n        'can interpolate %s',\n        (outputRange) => {\n          const config = {\n            inputRange: [0, 1],\n            outputRange\n          };\n          const animVal = new Animated.Value(0);\n          const result = animVal.interpolate(config);\n          expect(result).toBeInstanceOf(Animated.Interpolation);\n        }\n      );\n    });\n\n    it('should work with defaults', () => {\n      const interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [0, 1],\n        outputRange: [0, 1]\n      });\n\n      expect(interpolation(0)).toBe(0);\n      expect(interpolation(0.5)).toBe(0.5);\n      expect(interpolation(0.8)).toBe(0.8);\n      expect(interpolation(1)).toBe(1);\n    });\n\n    it('should work with output range', () => {\n      const interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [0, 1],\n        outputRange: [100, 200]\n      });\n\n      expect(interpolation(0)).toBe(100);\n      expect(interpolation(0.5)).toBe(150);\n      expect(interpolation(0.8)).toBe(180);\n      expect(interpolation(1)).toBe(200);\n    });\n\n    it('should work with input range', () => {\n      const interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [100, 200],\n        outputRange: [0, 1]\n      });\n\n      expect(interpolation(100)).toBe(0);\n      expect(interpolation(150)).toBe(0.5);\n      expect(interpolation(180)).toBe(0.8);\n      expect(interpolation(200)).toBe(1);\n    });\n\n    it('should throw for non monotonic input ranges', () => {\n      expect(() =>\n        AnimatedInterpolation.__createInterpolation({\n          inputRange: [0, 2, 1],\n          outputRange: [0, 1, 2]\n        })\n      ).toThrow();\n\n      expect(() =>\n        AnimatedInterpolation.__createInterpolation({\n          inputRange: [0, 1, 2],\n          outputRange: [0, 3, 1]\n        })\n      ).not.toThrow();\n    });\n\n    it('should work with empty input range', () => {\n      const interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [0, 10, 10],\n        outputRange: [1, 2, 3],\n        extrapolate: 'extend'\n      });\n\n      expect(interpolation(0)).toBe(1);\n      expect(interpolation(5)).toBe(1.5);\n      expect(interpolation(10)).toBe(2);\n      expect(interpolation(10.1)).toBe(3);\n      expect(interpolation(15)).toBe(3);\n    });\n\n    it('should work with empty output range', () => {\n      const interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [1, 2, 3],\n        outputRange: [0, 10, 10],\n        extrapolate: 'extend'\n      });\n\n      expect(interpolation(0)).toBe(-10);\n      expect(interpolation(1.5)).toBe(5);\n      expect(interpolation(2)).toBe(10);\n      expect(interpolation(2.5)).toBe(10);\n      expect(interpolation(3)).toBe(10);\n      expect(interpolation(4)).toBe(10);\n    });\n\n    it('should work with easing', () => {\n      const interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [0, 1],\n        outputRange: [0, 1],\n        easing: Easing.quad\n      });\n\n      expect(interpolation(0)).toBe(0);\n      expect(interpolation(0.5)).toBe(0.25);\n      expect(interpolation(0.9)).toBe(0.81);\n      expect(interpolation(1)).toBe(1);\n    });\n\n    it('should work with extrapolate', () => {\n      let interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [0, 1],\n        outputRange: [0, 1],\n        extrapolate: 'extend',\n        easing: Easing.quad\n      });\n\n      expect(interpolation(-2)).toBe(4);\n      expect(interpolation(2)).toBe(4);\n\n      interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [0, 1],\n        outputRange: [0, 1],\n        extrapolate: 'clamp',\n        easing: Easing.quad\n      });\n\n      expect(interpolation(-2)).toBe(0);\n      expect(interpolation(2)).toBe(1);\n\n      interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [0, 1],\n        outputRange: [0, 1],\n        extrapolate: 'identity',\n        easing: Easing.quad\n      });\n\n      expect(interpolation(-2)).toBe(-2);\n      expect(interpolation(2)).toBe(2);\n    });\n\n    it('should work with keyframes with extrapolate', () => {\n      const interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [0, 10, 100, 1000],\n        outputRange: [0, 5, 50, 500],\n        extrapolate: true\n      });\n\n      expect(interpolation(-5)).toBe(-2.5);\n      expect(interpolation(0)).toBe(0);\n      expect(interpolation(5)).toBe(2.5);\n      expect(interpolation(10)).toBe(5);\n      expect(interpolation(50)).toBe(25);\n      expect(interpolation(100)).toBe(50);\n      expect(interpolation(500)).toBe(250);\n      expect(interpolation(1000)).toBe(500);\n      expect(interpolation(2000)).toBe(1000);\n    });\n\n    it('should work with keyframes without extrapolate', () => {\n      const interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [0, 1, 2],\n        outputRange: [0.2, 1, 0.2],\n        extrapolate: 'clamp'\n      });\n\n      expect(interpolation(5)).toBeCloseTo(0.2);\n    });\n\n    it('should throw for an infinite input range', () => {\n      expect(() =>\n        AnimatedInterpolation.__createInterpolation({\n          inputRange: [-Infinity, Infinity],\n          outputRange: [0, 1]\n        })\n      ).toThrow();\n\n      expect(() =>\n        AnimatedInterpolation.__createInterpolation({\n          inputRange: [-Infinity, 0, Infinity],\n          outputRange: [1, 2, 3]\n        })\n      ).not.toThrow();\n    });\n\n    it('should work with negative infinite', () => {\n      const interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [-Infinity, 0],\n        outputRange: [-Infinity, 0],\n        easing: Easing.quad,\n        extrapolate: 'identity'\n      });\n\n      expect(interpolation(-Infinity)).toBe(-Infinity);\n      expect(interpolation(-100)).toBeCloseTo(-10000);\n      expect(interpolation(-10)).toBeCloseTo(-100);\n      expect(interpolation(0)).toBeCloseTo(0);\n      expect(interpolation(1)).toBeCloseTo(1);\n      expect(interpolation(100)).toBeCloseTo(100);\n    });\n\n    it('should work with positive infinite', () => {\n      const interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [5, Infinity],\n        outputRange: [5, Infinity],\n        easing: Easing.quad,\n        extrapolate: 'identity'\n      });\n\n      expect(interpolation(-100)).toBeCloseTo(-100);\n      expect(interpolation(-10)).toBeCloseTo(-10);\n      expect(interpolation(0)).toBeCloseTo(0);\n      expect(interpolation(5)).toBeCloseTo(5);\n      expect(interpolation(6)).toBeCloseTo(5 + 1);\n      expect(interpolation(10)).toBeCloseTo(5 + 25);\n      expect(interpolation(100)).toBeCloseTo(5 + 95 * 95);\n      expect(interpolation(Infinity)).toBe(Infinity);\n    });\n\n    it('should work with output ranges as string', () => {\n      const interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [0, 1],\n        outputRange: ['rgba(0, 100, 200, 0)', 'rgba(50, 150, 250, 0.4)']\n      });\n\n      expect(interpolation(0)).toBe('rgba(0, 100, 200, 0)');\n      expect(interpolation(0.5)).toBe('rgba(25, 125, 225, 0.2)');\n      expect(interpolation(1)).toBe('rgba(50, 150, 250, 0.4)');\n    });\n\n    it('should work with output ranges as short hex string', () => {\n      const interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [0, 1],\n        outputRange: ['#024', '#9BF']\n      });\n\n      expect(interpolation(0)).toBe('rgba(0, 34, 68, 1)');\n      expect(interpolation(0.5)).toBe('rgba(77, 111, 162, 1)');\n      expect(interpolation(1)).toBe('rgba(153, 187, 255, 1)');\n    });\n\n    it('should work with output ranges as long hex string', () => {\n      const interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [0, 1],\n        outputRange: ['#FF9500', '#87FC70']\n      });\n\n      expect(interpolation(0)).toBe('rgba(255, 149, 0, 1)');\n      expect(interpolation(0.5)).toBe('rgba(195, 201, 56, 1)');\n      expect(interpolation(1)).toBe('rgba(135, 252, 112, 1)');\n    });\n\n    it('should work with output ranges with mixed hex and rgba strings', () => {\n      const interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [0, 1],\n        outputRange: ['rgba(100, 120, 140, .4)', '#87FC70']\n      });\n\n      expect(interpolation(0)).toBe('rgba(100, 120, 140, 0.4)');\n      expect(interpolation(0.5)).toBe('rgba(118, 186, 126, 0.7)');\n      expect(interpolation(1)).toBe('rgba(135, 252, 112, 1)');\n    });\n\n    it('should work with negative and decimal values in string ranges', () => {\n      const interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [0, 1],\n        outputRange: ['-100.5deg', '100deg']\n      });\n\n      expect(interpolation(0)).toBe('-100.5deg');\n      expect(interpolation(0.5)).toBe('-0.25deg');\n      expect(interpolation(1)).toBe('100deg');\n    });\n\n    it('should crash when chaining an interpolation that returns a string', () => {\n      const interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [0, 1],\n        outputRange: [0, 1]\n      });\n      expect(() => {\n        interpolation('45rad');\n      }).toThrow();\n    });\n\n    it('should support a mix of color patterns', () => {\n      const interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [0, 1, 2],\n        outputRange: ['rgba(0, 100, 200, 0)', 'rgb(50, 150, 250)', 'red']\n      });\n\n      expect(interpolation(0)).toBe('rgba(0, 100, 200, 0)');\n      expect(interpolation(0.5)).toBe('rgba(25, 125, 225, 0.5)');\n      expect(interpolation(1.5)).toBe('rgba(153, 75, 125, 1)');\n      expect(interpolation(2)).toBe('rgba(255, 0, 0, 1)');\n    });\n\n    it('should crash when defining output range with different pattern', () => {\n      expect(() =>\n        AnimatedInterpolation.__createInterpolation({\n          inputRange: [0, 1],\n          outputRange: ['20deg', '30rad']\n        })\n      ).toThrow();\n    });\n\n    it('should round the alpha channel of a color to the nearest thousandth', () => {\n      const interpolation = AnimatedInterpolation.__createInterpolation({\n        inputRange: [0, 1],\n        outputRange: ['rgba(0, 0, 0, 0)', 'rgba(0, 0, 0, 1)']\n      });\n\n      expect(interpolation(1e-12)).toBe('rgba(0, 0, 0, 0)');\n      expect(interpolation(2 / 3)).toBe('rgba(0, 0, 0, 0.667)');\n    });\n  });\n\n  describe('sequence and loop', () => {\n    it('supports restarting sequence after it was stopped during execution', () => {\n      const anim1 = { start: jest.fn(), stop: jest.fn() };\n      const anim2 = { start: jest.fn(), stop: jest.fn() };\n      const cb = jest.fn();\n\n      const seq = AnimatedImplementation.sequence([anim1, anim2]);\n\n      seq.start(cb);\n\n      anim1.start.mock.calls[0][0]({ finished: true });\n      seq.stop();\n\n      // anim1 should be finished so anim2 should also start\n      expect(anim1.start).toHaveBeenCalledTimes(1);\n      expect(anim2.start).toHaveBeenCalledTimes(1);\n\n      seq.start(cb);\n\n      // after restart the sequence should resume from the anim2\n      expect(anim1.start).toHaveBeenCalledTimes(1);\n      expect(anim2.start).toHaveBeenCalledTimes(2);\n    });\n\n    it('supports restarting sequence after it was finished without a reset', () => {\n      const anim1 = { start: jest.fn(), stop: jest.fn() };\n      const anim2 = { start: jest.fn(), stop: jest.fn() };\n      const cb = jest.fn();\n\n      const seq = AnimatedImplementation.sequence([anim1, anim2]);\n\n      seq.start(cb);\n      anim1.start.mock.calls[0][0]({ finished: true });\n      anim2.start.mock.calls[0][0]({ finished: true });\n\n      // sequence should be finished\n      expect(cb).toBeCalledWith({ finished: true });\n\n      seq.start(cb);\n\n      // sequence should successfully restart from the anim1\n      expect(anim1.start).toHaveBeenCalledTimes(2);\n      expect(anim2.start).toHaveBeenCalledTimes(1);\n    });\n\n    it('restarts sequence normally in a loop if resetBeforeIteration is false', () => {\n      const anim1 = { start: jest.fn(), stop: jest.fn() };\n      const anim2 = { start: jest.fn(), stop: jest.fn() };\n      const seq = AnimatedImplementation.sequence([anim1, anim2]);\n\n      const loop = AnimatedImplementation.loop(seq, {\n        resetBeforeIteration: false\n      });\n\n      loop.start();\n\n      expect(anim1.start).toHaveBeenCalledTimes(1);\n\n      anim1.start.mock.calls[0][0]({ finished: true });\n\n      expect(anim2.start).toHaveBeenCalledTimes(1);\n\n      anim2.start.mock.calls[0][0]({ finished: true });\n\n      // after anim2 is finished, the sequence is finished,\n      // hence the loop iteration is finished, so the next iteration starts\n      expect(anim1.start).toHaveBeenCalledTimes(2);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Animated/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\n'use client';\n\nimport Animated from '../../vendor/react-native/Animated/Animated';\nexport default Animated;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/AppRegistry/AppContainer.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport * as React from 'react';\nimport StyleSheet from '../StyleSheet';\nimport View from '../View';\n\ntype Props = {\n  WrapperComponent?: ?React.ComponentType<*>,\n  // $FlowFixMe\n  children?: React.Children,\n  rootTag: any\n};\n\nconst RootTagContext: React.Context<any> = React.createContext(null);\n\nconst AppContainer: React.AbstractComponent<Props> = React.forwardRef(\n  (props: Props, forwardedRef?: React.Ref<any>) => {\n    const { children, WrapperComponent } = props;\n\n    let innerView = (\n      <View children={children} key={1} style={styles.appContainer} />\n    );\n\n    if (WrapperComponent) {\n      innerView = <WrapperComponent>{innerView}</WrapperComponent>;\n    }\n\n    return (\n      <RootTagContext.Provider value={props.rootTag}>\n        <View ref={forwardedRef} style={styles.appContainer}>\n          {innerView}\n        </View>\n      </RootTagContext.Provider>\n    );\n  }\n);\n\nAppContainer.displayName = 'AppContainer';\n\nexport default AppContainer;\n\nconst styles = StyleSheet.create({\n  appContainer: {\n    flex: 1,\n    pointerEvents: 'box-none'\n  }\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/AppRegistry/__tests__/__snapshots__/index-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`AppRegistry runApplication styles roots in different documents 1`] = `\n[\n  \"[stylesheet-group=\"0\"] {}\",\n  \"body {margin: 0;}\",\n  \"button::-moz-focus-inner,input::-moz-focus-inner {border: 0; padding: 0;}\",\n  \"html {-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: rgba(0,0,0,0);}\",\n  \"input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration {display: none;}\",\n  \"[stylesheet-group=\"1\"] {}\",\n  \".css-view-g5y9jx {align-content: flex-start; align-items: stretch; background-color: rgba(0,0,0,0.00); border: 0 solid black; box-sizing: border-box; display: flex; flex-basis: auto; flex-direction: column; flex-shrink: 0; list-style: none; margin: 0px; min-height: 0px; min-width: 0px; padding: 0px; position: relative; text-decoration: none; z-index: 0;}\",\n  \"[stylesheet-group=\"2\"] {}\",\n  \".r-display-xoduu5 {display: inline-flex;}\",\n  \".r-flex-13awgt0 {flex: 1;}\",\n  \"[stylesheet-group=\"3\"] {}\",\n  \".r-bottom-1p0dtai {bottom: 0px;}\",\n  \".r-left-1d2f490 {left: 0px;}\",\n  \".r-pointerEvents-105ug2t {pointer-events: auto !important;}\",\n  \".r-pointerEvents-12vffkv>* {pointer-events: auto;}\",\n  \".r-pointerEvents-12vffkv {pointer-events: none !important;}\",\n  \".r-pointerEvents-633pao>* {pointer-events: none;}\",\n  \".r-pointerEvents-633pao {pointer-events: none !important;}\",\n  \".r-pointerEvents-ah5dr5>* {pointer-events: none;}\",\n  \".r-pointerEvents-ah5dr5 {pointer-events: auto !important;}\",\n  \".r-position-u8s1d {position: absolute;}\",\n  \".r-right-zchlnj {right: 0px;}\",\n  \".r-top-ipm5af {top: 0px;}\",\n]\n`;\n\nexports[`AppRegistry runApplication styles roots in different documents 2`] = `\n[\n  \"[stylesheet-group=\"0\"] {}\",\n  \"body {margin: 0;}\",\n  \"button::-moz-focus-inner,input::-moz-focus-inner {border: 0; padding: 0;}\",\n  \"html {-ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: rgba(0,0,0,0);}\",\n  \"input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration {display: none;}\",\n  \"[stylesheet-group=\"1\"] {}\",\n  \".css-view-g5y9jx {align-content: flex-start; align-items: stretch; background-color: rgba(0,0,0,0.00); border: 0 solid black; box-sizing: border-box; display: flex; flex-basis: auto; flex-direction: column; flex-shrink: 0; list-style: none; margin: 0px; min-height: 0px; min-width: 0px; padding: 0px; position: relative; text-decoration: none; z-index: 0;}\",\n  \"[stylesheet-group=\"2\"] {}\",\n  \".r-display-xoduu5 {display: inline-flex;}\",\n  \".r-flex-13awgt0 {flex: 1;}\",\n  \"[stylesheet-group=\"3\"] {}\",\n  \".r-bottom-1p0dtai {bottom: 0px;}\",\n  \".r-left-1d2f490 {left: 0px;}\",\n  \".r-pointerEvents-105ug2t {pointer-events: auto !important;}\",\n  \".r-pointerEvents-12vffkv>* {pointer-events: auto;}\",\n  \".r-pointerEvents-12vffkv {pointer-events: none !important;}\",\n  \".r-pointerEvents-633pao>* {pointer-events: none;}\",\n  \".r-pointerEvents-633pao {pointer-events: none !important;}\",\n  \".r-pointerEvents-ah5dr5>* {pointer-events: none;}\",\n  \".r-pointerEvents-ah5dr5 {pointer-events: auto !important;}\",\n  \".r-position-u8s1d {position: absolute;}\",\n  \".r-right-zchlnj {right: 0px;}\",\n  \".r-top-ipm5af {top: 0px;}\",\n]\n`;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/AppRegistry/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport AppRegistry from '..';\nimport React from 'react';\nimport { act } from '@testing-library/react';\nconst NoopComponent = () => React.createElement('div');\n\ndescribe.each([['concurrent'], ['legacy']])('AppRegistry', (mode) => {\n  describe('runApplication', () => {\n    let rootTag;\n\n    beforeEach(() => {\n      rootTag = document.createElement('div');\n      rootTag.id = 'react-root';\n      document.body.appendChild(rootTag);\n    });\n\n    afterEach(() => {\n      document.body.removeChild(rootTag);\n    });\n\n    test('callback after render', () => {\n      const callback = jest.fn();\n      AppRegistry.registerComponent('App', () => NoopComponent);\n      act(() => {\n        AppRegistry.runApplication('App', {\n          initialProps: {},\n          rootTag,\n          callback,\n          mode\n        });\n      });\n      expect(callback).toHaveBeenCalledTimes(1);\n    });\n\n    test('unmount ran application', () => {\n      const setMountedState = jest.fn();\n      const MountedStateComponent = () => {\n        React.useEffect(() => {\n          setMountedState(true);\n          return () => {\n            setMountedState(false);\n          };\n        }, []);\n        return <NoopComponent />;\n      };\n\n      AppRegistry.registerComponent('App', () => MountedStateComponent);\n      let application;\n      act(() => {\n        application = AppRegistry.runApplication('App', {\n          initialProps: {},\n          rootTag,\n          mode\n        });\n      });\n      expect(setMountedState).toHaveBeenCalledTimes(1);\n      expect(setMountedState).toHaveBeenLastCalledWith(true);\n      act(() => {\n        application.unmount();\n      });\n      expect(setMountedState).toHaveBeenCalledTimes(2);\n      expect(setMountedState).toHaveBeenLastCalledWith(false);\n    });\n\n    test('styles roots in different documents', () => {\n      AppRegistry.registerComponent('App', () => NoopComponent);\n      act(() => {\n        AppRegistry.runApplication('App', { initialProps: {}, rootTag, mode });\n      });\n      // Create iframe context\n      const iframe = document.createElement('iframe');\n      document.body.appendChild(iframe);\n\n      const iframeRootTag = document.createElement('div');\n      iframeRootTag.id = 'react-iframe-root';\n      iframe.contentWindow.document.body.appendChild(iframeRootTag);\n\n      // Run in iframe\n      AppRegistry.registerComponent('App', () => NoopComponent);\n      act(() => {\n        AppRegistry.runApplication('App', {\n          initialProps: {},\n          rootTag: iframeRootTag,\n          mode\n        });\n      });\n\n      const iframedoc = iframeRootTag.ownerDocument;\n      expect(iframedoc).toBe(iframe.contentWindow.document);\n      expect(iframedoc).not.toBe(document);\n\n      const cssText = Array.prototype.slice\n        .call(\n          iframedoc.getElementById('react-native-stylesheet').sheet.cssRules\n        )\n        .map((cssRule) => cssRule.cssText);\n\n      expect(cssText).toMatchSnapshot();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/AppRegistry/__tests__/index-test.node.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport AppRegistry from '..';\nimport React from 'react';\nimport ReactDOMServer from 'react-dom/server';\nimport StyleSheet from '../../StyleSheet';\nimport Text from '../../Text';\nimport View from '../../View';\n\nconst NoopComponent = () => React.createElement('div');\n\ndescribe('AppRegistry', () => {\n  describe('getApplication', () => {\n    test('does not throw when missing appParameters', () => {\n      AppRegistry.registerComponent('App', () => NoopComponent);\n      expect(() => AppRegistry.getApplication('App')).not.toThrow();\n    });\n\n    test('returns \"element\" and \"getStyleElement\"', () => {\n      AppRegistry.registerComponent('App', () => NoopComponent);\n      const { element, getStyleElement } = AppRegistry.getApplication(\n        'App',\n        {}\n      );\n      const styleElement = ReactDOMServer.renderToStaticMarkup(\n        getStyleElement()\n      );\n\n      expect(element).toMatchInlineSnapshot(`\n        <AppContainer\n          rootTag={{}}\n        >\n          <NoopComponent />\n        </AppContainer>\n      `);\n      expect(styleElement).toMatchInlineSnapshot(`\n        \"<style id=\"react-native-stylesheet\">[stylesheet-group=\"0\"]{}\n        body{margin:0;}\n        button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}\n        html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}\n        input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}\n        [stylesheet-group=\"1\"]{}\n        .css-text-146c3p1{background-color:rgba(0,0,0,0.00);border:0 solid black;box-sizing:border-box;color:rgba(0,0,0,1.00);display:inline;font:14px -apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;list-style:none;margin:0px;padding:0px;position:relative;text-align:start;text-decoration:none;white-space:pre-wrap;word-wrap:break-word;}\n        .css-textHasAncestor-1jxf684{background-color:rgba(0,0,0,0.00);border:0 solid black;box-sizing:border-box;color:inherit;display:inline;font:inherit;list-style:none;margin:0px;padding:0px;position:relative;text-align:inherit;text-decoration:none;white-space:inherit;word-wrap:break-word;}\n        .css-view-g5y9jx{align-content:flex-start;align-items:stretch;background-color:rgba(0,0,0,0.00);border:0 solid black;box-sizing:border-box;display:flex;flex-basis:auto;flex-direction:column;flex-shrink:0;list-style:none;margin:0px;min-height:0px;min-width:0px;padding:0px;position:relative;text-decoration:none;z-index:0;}\n        [stylesheet-group=\"2\"]{}\n        .r-display-krxsd3{display:-webkit-box;}\n        .r-display-xoduu5{display:inline-flex;}\n        .r-flex-13awgt0{flex:1;}\n        .r-overflow-1qsk4np{overflow-x:clip;overflow-y:clip;}\n        .r-overflow-1udh08x{overflow-x:hidden;overflow-y:hidden;}\n        [stylesheet-group=\"3\"]{}\n        .r-WebkitBoxOrient-8akbws{-webkit-box-orient:vertical;}\n        .r-bottom-1p0dtai{bottom:0px;}\n        .r-cursor-1loqt21{cursor:pointer;}\n        .r-left-1d2f490{left:0px;}\n        .r-maxWidth-dnmrzs{max-width:100%;}\n        .r-pointerEvents-105ug2t{pointer-events:auto!important;}\n        .r-pointerEvents-12vffkv>* {pointer-events:auto;}\n        .r-pointerEvents-12vffkv{pointer-events:none!important;}\n        .r-pointerEvents-633pao>* {pointer-events:none;}\n        .r-pointerEvents-633pao{pointer-events:none!important;}\n        .r-pointerEvents-ah5dr5>* {pointer-events:none;}\n        .r-pointerEvents-ah5dr5{pointer-events:auto!important;}\n        .r-position-u8s1d{position:absolute;}\n        .r-right-zchlnj{right:0px;}\n        .r-textOverflow-1udbk01{text-overflow:ellipsis;}\n        .r-top-ipm5af{top:0px;}\n        .r-userSelect-1xnzce8{-moz-user-select:text;-webkit-user-select:text;user-select:text;}\n        .r-userSelect-lrvibr{-moz-user-select:none;-webkit-user-select:none;user-select:none;}\n        .r-whiteSpace-3s2u2q{white-space:nowrap;}\n        .r-wordWrap-1iln25a{word-wrap:normal;}</style>\"\n      `);\n    });\n\n    test('\"getStyleElement\" adds props to <style>', () => {\n      const nonce = '2Bz9RM/UHvBbmo3jK/PbYZ==';\n      AppRegistry.registerComponent('App', () => NoopComponent);\n      const { getStyleElement } = AppRegistry.getApplication('App', {});\n      const styleElement = getStyleElement({ nonce });\n      expect(styleElement.props.nonce).toBe(nonce);\n    });\n\n    test('\"getStyleElement\" contains style updates', () => {\n      const getApplicationStyles = (appName) => {\n        const { getStyleElement } = AppRegistry.getApplication(appName, {});\n        return getStyleElement().props.dangerouslySetInnerHTML.__html;\n      };\n\n      // First render \"RootComponent\"\n      const RootComponent = () =>\n        React.createElement(View, React.createElement(Text));\n      AppRegistry.registerComponent('App', () => RootComponent);\n      const first = getApplicationStyles('App');\n      expect(first).toMatchInlineSnapshot(`\n        \"[stylesheet-group=\"0\"]{}\n        body{margin:0;}\n        button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}\n        html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}\n        input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}\n        [stylesheet-group=\"1\"]{}\n        .css-text-146c3p1{background-color:rgba(0,0,0,0.00);border:0 solid black;box-sizing:border-box;color:rgba(0,0,0,1.00);display:inline;font:14px -apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;list-style:none;margin:0px;padding:0px;position:relative;text-align:start;text-decoration:none;white-space:pre-wrap;word-wrap:break-word;}\n        .css-textHasAncestor-1jxf684{background-color:rgba(0,0,0,0.00);border:0 solid black;box-sizing:border-box;color:inherit;display:inline;font:inherit;list-style:none;margin:0px;padding:0px;position:relative;text-align:inherit;text-decoration:none;white-space:inherit;word-wrap:break-word;}\n        .css-view-g5y9jx{align-content:flex-start;align-items:stretch;background-color:rgba(0,0,0,0.00);border:0 solid black;box-sizing:border-box;display:flex;flex-basis:auto;flex-direction:column;flex-shrink:0;list-style:none;margin:0px;min-height:0px;min-width:0px;padding:0px;position:relative;text-decoration:none;z-index:0;}\n        [stylesheet-group=\"2\"]{}\n        .r-display-krxsd3{display:-webkit-box;}\n        .r-display-xoduu5{display:inline-flex;}\n        .r-flex-13awgt0{flex:1;}\n        .r-overflow-1qsk4np{overflow-x:clip;overflow-y:clip;}\n        .r-overflow-1udh08x{overflow-x:hidden;overflow-y:hidden;}\n        [stylesheet-group=\"3\"]{}\n        .r-WebkitBoxOrient-8akbws{-webkit-box-orient:vertical;}\n        .r-bottom-1p0dtai{bottom:0px;}\n        .r-cursor-1loqt21{cursor:pointer;}\n        .r-left-1d2f490{left:0px;}\n        .r-maxWidth-dnmrzs{max-width:100%;}\n        .r-pointerEvents-105ug2t{pointer-events:auto!important;}\n        .r-pointerEvents-12vffkv>* {pointer-events:auto;}\n        .r-pointerEvents-12vffkv{pointer-events:none!important;}\n        .r-pointerEvents-633pao>* {pointer-events:none;}\n        .r-pointerEvents-633pao{pointer-events:none!important;}\n        .r-pointerEvents-ah5dr5>* {pointer-events:none;}\n        .r-pointerEvents-ah5dr5{pointer-events:auto!important;}\n        .r-position-u8s1d{position:absolute;}\n        .r-right-zchlnj{right:0px;}\n        .r-textOverflow-1udbk01{text-overflow:ellipsis;}\n        .r-top-ipm5af{top:0px;}\n        .r-userSelect-1xnzce8{-moz-user-select:text;-webkit-user-select:text;user-select:text;}\n        .r-userSelect-lrvibr{-moz-user-select:none;-webkit-user-select:none;user-select:none;}\n        .r-whiteSpace-3s2u2q{white-space:nowrap;}\n        .r-wordWrap-1iln25a{word-wrap:normal;}\"\n      `);\n\n      // Second render \"AlternativeComponent\"\n      const styles = StyleSheet.create({\n        root: { borderWidth: 1234, backgroundColor: 'purple' }\n      });\n      const AlternativeComponent = () =>\n        React.createElement(View, { style: styles.root });\n      AppRegistry.registerComponent(\n        'AlternativeApp',\n        () => AlternativeComponent\n      );\n      const second = getApplicationStyles('AlternativeApp');\n      expect(second).toMatchInlineSnapshot(`\n        \"[stylesheet-group=\"0\"]{}\n        body{margin:0;}\n        button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}\n        html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}\n        input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}\n        [stylesheet-group=\"1\"]{}\n        .css-text-146c3p1{background-color:rgba(0,0,0,0.00);border:0 solid black;box-sizing:border-box;color:rgba(0,0,0,1.00);display:inline;font:14px -apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;list-style:none;margin:0px;padding:0px;position:relative;text-align:start;text-decoration:none;white-space:pre-wrap;word-wrap:break-word;}\n        .css-textHasAncestor-1jxf684{background-color:rgba(0,0,0,0.00);border:0 solid black;box-sizing:border-box;color:inherit;display:inline;font:inherit;list-style:none;margin:0px;padding:0px;position:relative;text-align:inherit;text-decoration:none;white-space:inherit;word-wrap:break-word;}\n        .css-view-g5y9jx{align-content:flex-start;align-items:stretch;background-color:rgba(0,0,0,0.00);border:0 solid black;box-sizing:border-box;display:flex;flex-basis:auto;flex-direction:column;flex-shrink:0;list-style:none;margin:0px;min-height:0px;min-width:0px;padding:0px;position:relative;text-decoration:none;z-index:0;}\n        [stylesheet-group=\"2\"]{}\n        .r-borderWidth-1bee2fs{border-bottom-width:1234px;border-left-width:1234px;border-right-width:1234px;border-top-width:1234px;}\n        .r-display-krxsd3{display:-webkit-box;}\n        .r-display-xoduu5{display:inline-flex;}\n        .r-flex-13awgt0{flex:1;}\n        .r-overflow-1qsk4np{overflow-x:clip;overflow-y:clip;}\n        .r-overflow-1udh08x{overflow-x:hidden;overflow-y:hidden;}\n        [stylesheet-group=\"3\"]{}\n        .r-WebkitBoxOrient-8akbws{-webkit-box-orient:vertical;}\n        .r-backgroundColor-aot4c7{background-color:rgba(128,0,128,1.00);}\n        .r-bottom-1p0dtai{bottom:0px;}\n        .r-cursor-1loqt21{cursor:pointer;}\n        .r-left-1d2f490{left:0px;}\n        .r-maxWidth-dnmrzs{max-width:100%;}\n        .r-pointerEvents-105ug2t{pointer-events:auto!important;}\n        .r-pointerEvents-12vffkv>* {pointer-events:auto;}\n        .r-pointerEvents-12vffkv{pointer-events:none!important;}\n        .r-pointerEvents-633pao>* {pointer-events:none;}\n        .r-pointerEvents-633pao{pointer-events:none!important;}\n        .r-pointerEvents-ah5dr5>* {pointer-events:none;}\n        .r-pointerEvents-ah5dr5{pointer-events:auto!important;}\n        .r-position-u8s1d{position:absolute;}\n        .r-right-zchlnj{right:0px;}\n        .r-textOverflow-1udbk01{text-overflow:ellipsis;}\n        .r-top-ipm5af{top:0px;}\n        .r-userSelect-1xnzce8{-moz-user-select:text;-webkit-user-select:text;user-select:text;}\n        .r-userSelect-lrvibr{-moz-user-select:none;-webkit-user-select:none;user-select:none;}\n        .r-whiteSpace-3s2u2q{white-space:nowrap;}\n        .r-wordWrap-1iln25a{word-wrap:normal;}\"\n      `);\n\n      // Third render \"RootComponent\" again\n      const third = getApplicationStyles('App');\n      expect(third).toEqual(second);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/AppRegistry/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use client';\n\nimport type { Application } from './renderApplication';\nimport type { ComponentType, Node } from 'react';\n\nimport invariant from 'fbjs/lib/invariant';\nimport unmountComponentAtNode from '../unmountComponentAtNode';\nimport renderApplication, { getApplication } from './renderApplication';\n\ntype AppParams = Object;\ntype Runnable = {|\n  getApplication?: (AppParams) => {|\n    element: Node,\n    getStyleElement: (any) => Node\n  |},\n  run: (AppParams) => any\n|};\n\nexport type ComponentProvider = () => ComponentType<any>;\nexport type ComponentProviderInstrumentationHook = (\n  component: ComponentProvider\n) => ComponentType<any>;\nexport type WrapperComponentProvider = (any) => ComponentType<*>;\n\nexport type AppConfig = {\n  appKey: string,\n  component?: ComponentProvider,\n  run?: Function,\n  section?: boolean\n};\n\nconst emptyObject = {};\nconst runnables: {| [appKey: string]: Runnable |} = {};\n\nlet componentProviderInstrumentationHook: ComponentProviderInstrumentationHook =\n  (component: ComponentProvider) => component();\nlet wrapperComponentProvider: ?WrapperComponentProvider;\n\n/**\n * `AppRegistry` is the JS entry point to running all React Native apps.\n */\nexport default class AppRegistry {\n  static getAppKeys(): Array<string> {\n    return Object.keys(runnables);\n  }\n\n  static getApplication(\n    appKey: string,\n    appParameters?: AppParams\n  ): {| element: Node, getStyleElement: (any) => Node |} {\n    invariant(\n      runnables[appKey] && runnables[appKey].getApplication,\n      `Application ${appKey} has not been registered. ` +\n        'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.'\n    );\n\n    return runnables[appKey].getApplication(appParameters);\n  }\n\n  static registerComponent(\n    appKey: string,\n    componentProvider: ComponentProvider\n  ): string {\n    runnables[appKey] = {\n      getApplication: (appParameters) =>\n        getApplication(\n          componentProviderInstrumentationHook(componentProvider),\n          appParameters ? appParameters.initialProps : emptyObject,\n          wrapperComponentProvider && wrapperComponentProvider(appParameters)\n        ),\n      run: (appParameters): Application =>\n        renderApplication(\n          componentProviderInstrumentationHook(componentProvider),\n          wrapperComponentProvider && wrapperComponentProvider(appParameters),\n          appParameters.callback,\n          {\n            hydrate: appParameters.hydrate || false,\n            initialProps: appParameters.initialProps || emptyObject,\n            mode: appParameters.mode || 'concurrent',\n            rootTag: appParameters.rootTag\n          }\n        )\n    };\n    return appKey;\n  }\n\n  static registerConfig(config: Array<AppConfig>) {\n    config.forEach(({ appKey, component, run }) => {\n      if (run) {\n        AppRegistry.registerRunnable(appKey, run);\n      } else {\n        invariant(component, 'No component provider passed in');\n        AppRegistry.registerComponent(appKey, component);\n      }\n    });\n  }\n\n  // TODO: fix style sheet creation when using this method\n  static registerRunnable(appKey: string, run: Function): string {\n    runnables[appKey] = { run };\n    return appKey;\n  }\n\n  static runApplication(appKey: string, appParameters: Object): Application {\n    const isDevelopment =\n      process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test';\n    if (isDevelopment) {\n      const params = { ...appParameters };\n      params.rootTag = `#${params.rootTag.id}`;\n\n      console.log(\n        `Running application \"${appKey}\" with appParams:\\n`,\n        params,\n        `\\nDevelopment-level warnings: ${isDevelopment ? 'ON' : 'OFF'}.` +\n          `\\nPerformance optimizations: ${isDevelopment ? 'OFF' : 'ON'}.`\n      );\n    }\n\n    invariant(\n      runnables[appKey] && runnables[appKey].run,\n      `Application \"${appKey}\" has not been registered. ` +\n        'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.'\n    );\n\n    return runnables[appKey].run(appParameters);\n  }\n\n  static setComponentProviderInstrumentationHook(\n    hook: ComponentProviderInstrumentationHook\n  ) {\n    componentProviderInstrumentationHook = hook;\n  }\n\n  static setWrapperComponentProvider(provider: WrapperComponentProvider) {\n    wrapperComponentProvider = provider;\n  }\n\n  static unmountApplicationComponentAtRootTag(rootTag: Object) {\n    unmountComponentAtNode(rootTag);\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web/src/exports/AppRegistry/renderApplication.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport type { ComponentType, Node } from 'react';\n\nimport AppContainer from './AppContainer';\nimport invariant from 'fbjs/lib/invariant';\nimport render, { hydrate } from '../render';\nimport StyleSheet from '../StyleSheet';\nimport React from 'react';\n\nexport type Application = {\n  unmount: () => void\n};\n\nexport default function renderApplication<Props: Object>(\n  RootComponent: ComponentType<Props>,\n  WrapperComponent?: ?ComponentType<*>,\n  callback?: () => void,\n  options: {\n    hydrate: boolean,\n    initialProps: Props,\n    rootTag: any\n  }\n): Application {\n  const { hydrate: shouldHydrate, initialProps, rootTag } = options;\n  const renderFn = shouldHydrate ? hydrate : render;\n\n  invariant(rootTag, 'Expect to have a valid rootTag, instead got ', rootTag);\n\n  return renderFn(\n    <AppContainer\n      WrapperComponent={WrapperComponent}\n      ref={callback}\n      rootTag={rootTag}\n    >\n      <RootComponent {...initialProps} />\n    </AppContainer>,\n    rootTag\n  );\n}\n\nexport function getApplication(\n  RootComponent: ComponentType<Object>,\n  initialProps: Object,\n  WrapperComponent?: ?ComponentType<*>\n): {| element: Node, getStyleElement: (Object) => Node |} {\n  const element = (\n    <AppContainer WrapperComponent={WrapperComponent} rootTag={{}}>\n      <RootComponent {...initialProps} />\n    </AppContainer>\n  );\n  // Don't escape CSS text\n  const getStyleElement = (props) => {\n    const sheet = StyleSheet.getSheet();\n    return (\n      <style\n        {...props}\n        dangerouslySetInnerHTML={{ __html: sheet.textContent }}\n        id={sheet.id}\n      />\n    );\n  };\n  return { element, getStyleElement };\n}\n"
  },
  {
    "path": "packages/react-native-web/src/exports/AppState/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport AppState from '..';\n\ndescribe('apis/AppState', () => {\n  const handler = () => {};\n\n  describe('addEventListener', () => {\n    test('throws if the provided \"eventType\" is not supported', () => {\n      expect(() => AppState.addEventListener('foo', handler)).toThrow();\n      expect(() =>\n        AppState.addEventListener('change', handler).remove()\n      ).not.toThrow();\n    });\n\n    test('returns remove subscription', () => {\n      const subscription = AppState.addEventListener('change', handler);\n      expect(() => subscription.remove()).not.toThrow();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/AppState/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @noflow\n */\n\n'use client';\n\nimport invariant from 'fbjs/lib/invariant';\nimport EventEmitter from '../../vendor/react-native/vendor/emitter/EventEmitter';\nimport canUseDOM from '../../modules/canUseDom';\n\n// Android 4.4 browser\nconst isPrefixed =\n  canUseDOM &&\n  !document.hasOwnProperty('hidden') &&\n  document.hasOwnProperty('webkitHidden');\n\nconst EVENT_TYPES = ['change', 'memoryWarning'];\nconst VISIBILITY_CHANGE_EVENT = isPrefixed\n  ? 'webkitvisibilitychange'\n  : 'visibilitychange';\nconst VISIBILITY_STATE_PROPERTY = isPrefixed\n  ? 'webkitVisibilityState'\n  : 'visibilityState';\n\nconst AppStates = {\n  BACKGROUND: 'background',\n  ACTIVE: 'active'\n};\n\nlet changeEmitter = null;\n\nexport default class AppState {\n  static isAvailable = canUseDOM && !!document[VISIBILITY_STATE_PROPERTY];\n\n  static get currentState() {\n    if (!AppState.isAvailable) {\n      return AppStates.ACTIVE;\n    }\n\n    switch (document[VISIBILITY_STATE_PROPERTY]) {\n      case 'hidden':\n      case 'prerender':\n      case 'unloaded':\n        return AppStates.BACKGROUND;\n      default:\n        return AppStates.ACTIVE;\n    }\n  }\n\n  static addEventListener(type: string, handler: Function) {\n    if (AppState.isAvailable) {\n      invariant(\n        EVENT_TYPES.indexOf(type) !== -1,\n        'Trying to subscribe to unknown event: \"%s\"',\n        type\n      );\n      if (type === 'change') {\n        if (!changeEmitter) {\n          changeEmitter = new EventEmitter();\n\n          document.addEventListener(\n            VISIBILITY_CHANGE_EVENT,\n            () => {\n              if (changeEmitter) {\n                changeEmitter.emit('change', AppState.currentState);\n              }\n            },\n            false\n          );\n        }\n        return changeEmitter.addListener(type, handler);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Appearance/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use client';\n\nimport canUseDOM from '../../modules/canUseDom';\n\nexport type ColorSchemeName = 'light' | 'dark';\n\nexport type AppearancePreferences = {|\n  colorScheme: ColorSchemeName\n|};\n\ntype AppearanceListener = (preferences: AppearancePreferences) => void;\ntype DOMAppearanceListener = (ev: MediaQueryListEvent) => any;\n\nfunction getQuery(): MediaQueryList | null {\n  return canUseDOM && window.matchMedia != null\n    ? window.matchMedia('(prefers-color-scheme: dark)')\n    : null;\n}\n\nconst query = getQuery();\nconst listenerMapping = new WeakMap<\n  AppearanceListener,\n  DOMAppearanceListener\n>();\n\nconst Appearance = {\n  getColorScheme(): ColorSchemeName {\n    return query && query.matches ? 'dark' : 'light';\n  },\n\n  addChangeListener(listener: AppearanceListener): { remove: () => void } {\n    let mappedListener = listenerMapping.get(listener);\n    if (!mappedListener) {\n      mappedListener = ({ matches }: MediaQueryListEvent) => {\n        listener({ colorScheme: matches ? 'dark' : 'light' });\n      };\n      listenerMapping.set(listener, mappedListener);\n    }\n    if (query) {\n      query.addListener(mappedListener);\n    }\n\n    function remove(): void {\n      const mappedListener = listenerMapping.get(listener);\n      if (query && mappedListener) {\n        query.removeListener(mappedListener);\n      }\n      listenerMapping.delete(listener);\n    }\n\n    return { remove };\n  }\n};\n\nexport default Appearance;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/BackHandler/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nfunction emptyFunction() {}\n\nconst BackHandler = {\n  exitApp: emptyFunction,\n  addEventListener(): {| remove: () => void |} {\n    console.error(\n      'BackHandler is not supported on web and should not be used.'\n    );\n    return {\n      remove: emptyFunction\n    };\n  },\n  removeEventListener: emptyFunction\n};\n\nexport default BackHandler;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Button/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport * as React from 'react';\nimport StyleSheet from '../StyleSheet';\nimport TouchableOpacity from '../TouchableOpacity';\nimport Text from '../Text';\n//import { warnOnce } from '../../modules/warnOnce';\n\ntype ButtonProps = {|\n  accessibilityLabel?: ?string,\n  color?: ?string,\n  disabled?: boolean,\n  onPress?: ?(e: any) => void,\n  testID?: ?string,\n  title: string\n|};\n\nconst Button: React.AbstractComponent<\n  ButtonProps,\n  React.ElementRef<typeof TouchableOpacity>\n> = React.forwardRef((props, forwardedRef) => {\n  // warnOnce('Button', 'Button is deprecated. Please use Pressable.');\n\n  const { accessibilityLabel, color, disabled, onPress, testID, title } = props;\n\n  return (\n    <TouchableOpacity\n      accessibilityLabel={accessibilityLabel}\n      accessibilityRole=\"button\"\n      disabled={disabled}\n      focusable={!disabled}\n      onPress={onPress}\n      ref={forwardedRef}\n      style={[\n        styles.button,\n        color && { backgroundColor: color },\n        disabled && styles.buttonDisabled\n      ]}\n      testID={testID}\n    >\n      <Text style={[styles.text, disabled && styles.textDisabled]}>\n        {title}\n      </Text>\n    </TouchableOpacity>\n  );\n});\n\nButton.displayName = 'Button';\n\nconst styles = StyleSheet.create({\n  button: {\n    backgroundColor: '#2196F3',\n    borderRadius: 2\n  },\n  text: {\n    color: '#fff',\n    fontWeight: '500',\n    padding: 8,\n    textAlign: 'center',\n    textTransform: 'uppercase'\n  },\n  buttonDisabled: {\n    backgroundColor: '#dfdfdf'\n  },\n  textDisabled: {\n    color: '#a1a1a1'\n  }\n});\n\nexport type { ButtonProps };\n\nexport default Button;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/CheckBox/__tests__/__snapshots__/index-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`CheckBox prop \"accessibilityLabel\" value is set 1`] = `\n<div\n  aria-label=\"accessibility label\"\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-height-10ptun7 r-userSelect-lrvibr r-width-1janqcz\"\n>\n  <div\n    class=\"css-view-g5y9jx r-alignItems-1awozwy r-backgroundColor-14lw9ot r-borderColor-1awa8pu r-borderRadius-1jkafct r-borderStyle-1phboty r-borderWidth-d045u9 r-height-1pi2tsx r-justifyContent-1777fci r-width-13qz1uu\"\n  />\n  <input\n    class=\"r-appearance-30o5oe r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-margin-crgep1 r-padding-t60dpp r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-cursor-1ei5mc7\"\n    type=\"checkbox\"\n  />\n</div>\n`;\n\nexports[`CheckBox prop \"accessibilityReadOnly\" value is set 1`] = `\n<div\n  aria-readonly=\"true\"\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-height-10ptun7 r-userSelect-lrvibr r-width-1janqcz\"\n>\n  <div\n    class=\"css-view-g5y9jx r-alignItems-1awozwy r-backgroundColor-14lw9ot r-borderColor-1awa8pu r-borderRadius-1jkafct r-borderStyle-1phboty r-borderWidth-d045u9 r-height-1pi2tsx r-justifyContent-1777fci r-width-13qz1uu\"\n  />\n  <input\n    class=\"r-appearance-30o5oe r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-margin-crgep1 r-padding-t60dpp r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-cursor-1ei5mc7\"\n    readonly=\"\"\n    type=\"checkbox\"\n  />\n</div>\n`;\n\nexports[`CheckBox prop \"color\" value is set 1`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-height-10ptun7 r-userSelect-lrvibr r-width-1janqcz\"\n>\n  <div\n    class=\"css-view-g5y9jx r-alignItems-1awozwy r-borderRadius-1jkafct r-borderStyle-1phboty r-borderWidth-d045u9 r-height-1pi2tsx r-justifyContent-1777fci r-width-13qz1uu r-backgroundImage-rs94m5 r-backgroundRepeat-u6sd8q\"\n    style=\"background-color: rgb(173, 216, 230); border-top-color: rgba(173,216,230,1.00); border-right-color: rgba(173,216,230,1.00); border-bottom-color: rgba(173,216,230,1.00); border-left-color: rgba(173,216,230,1.00);\"\n  />\n  <input\n    checked=\"\"\n    class=\"r-appearance-30o5oe r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-margin-crgep1 r-padding-t60dpp r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-cursor-1ei5mc7\"\n    type=\"checkbox\"\n  />\n</div>\n`;\n\nexports[`CheckBox prop \"dataSet\" value is set 1`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-height-10ptun7 r-userSelect-lrvibr r-width-1janqcz\"\n  data-one=\"one\"\n  data-two=\"two\"\n>\n  <div\n    class=\"css-view-g5y9jx r-alignItems-1awozwy r-backgroundColor-14lw9ot r-borderColor-1awa8pu r-borderRadius-1jkafct r-borderStyle-1phboty r-borderWidth-d045u9 r-height-1pi2tsx r-justifyContent-1777fci r-width-13qz1uu\"\n  />\n  <input\n    class=\"r-appearance-30o5oe r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-margin-crgep1 r-padding-t60dpp r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-cursor-1ei5mc7\"\n    type=\"checkbox\"\n  />\n</div>\n`;\n\nexports[`CheckBox prop \"nativeID\" value is set 1`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-height-10ptun7 r-userSelect-lrvibr r-width-1janqcz\"\n  id=\"123\"\n>\n  <div\n    class=\"css-view-g5y9jx r-alignItems-1awozwy r-backgroundColor-14lw9ot r-borderColor-1awa8pu r-borderRadius-1jkafct r-borderStyle-1phboty r-borderWidth-d045u9 r-height-1pi2tsx r-justifyContent-1777fci r-width-13qz1uu\"\n  />\n  <input\n    class=\"r-appearance-30o5oe r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-margin-crgep1 r-padding-t60dpp r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-cursor-1ei5mc7\"\n    type=\"checkbox\"\n  />\n</div>\n`;\n\nexports[`CheckBox prop \"style\" value is set 1`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-height-10ptun7 r-userSelect-lrvibr r-width-1janqcz\"\n  style=\"border-top-width: 5px; border-right-width: 5px; border-bottom-width: 5px; border-left-width: 5px;\"\n>\n  <div\n    class=\"css-view-g5y9jx r-alignItems-1awozwy r-backgroundColor-14lw9ot r-borderColor-1awa8pu r-borderRadius-1jkafct r-borderStyle-1phboty r-borderWidth-d045u9 r-height-1pi2tsx r-justifyContent-1777fci r-width-13qz1uu\"\n  />\n  <input\n    class=\"r-appearance-30o5oe r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-margin-crgep1 r-padding-t60dpp r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-cursor-1ei5mc7\"\n    type=\"checkbox\"\n  />\n</div>\n`;\n\nexports[`CheckBox prop \"testID\" value is set 1`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-height-10ptun7 r-userSelect-lrvibr r-width-1janqcz\"\n  data-testid=\"123\"\n>\n  <div\n    class=\"css-view-g5y9jx r-alignItems-1awozwy r-backgroundColor-14lw9ot r-borderColor-1awa8pu r-borderRadius-1jkafct r-borderStyle-1phboty r-borderWidth-d045u9 r-height-1pi2tsx r-justifyContent-1777fci r-width-13qz1uu\"\n  />\n  <input\n    class=\"r-appearance-30o5oe r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-margin-crgep1 r-padding-t60dpp r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-cursor-1ei5mc7\"\n    type=\"checkbox\"\n  />\n</div>\n`;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/CheckBox/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport CheckBox from '../';\nimport React from 'react';\nimport { createEventTarget } from 'dom-event-testing-library';\nimport { act, render } from '@testing-library/react';\n\nfunction findCheckbox(container) {\n  return container.firstChild.querySelector('input');\n}\n\ndescribe('CheckBox', () => {\n  describe('prop \"accessibilityLabel\"', () => {\n    test('value is set', () => {\n      const { container } = render(\n        <CheckBox aria-label=\"accessibility label\" />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"accessibilityReadOnly\"', () => {\n    test('value is set', () => {\n      const { container } = render(<CheckBox aria-readonly={true} />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"color\"', () => {\n    test('value is set', () => {\n      const { container } = render(<CheckBox color=\"lightblue\" value={true} />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"dataSet\"', () => {\n    test('value is set', () => {\n      const { container } = render(\n        <CheckBox dataSet={{ one: 'one', two: 'two' }} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"disabled\"', () => {\n    test('when \"false\" a default checkbox is rendered', () => {\n      const { container } = render(<CheckBox />);\n      expect(findCheckbox(container).disabled).toBe(false);\n    });\n\n    test('when \"true\" a disabled checkbox is rendered', () => {\n      const { container } = render(<CheckBox disabled />);\n      expect(findCheckbox(container).disabled).toBe(true);\n    });\n  });\n\n  describe('prop \"nativeID\"', () => {\n    test('value is set', () => {\n      const { container } = render(<CheckBox id=\"123\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"onBlur\"', () => {\n    test('is called', () => {\n      const onBlur = jest.fn();\n      const ref = React.createRef();\n      act(() => {\n        render(<CheckBox onBlur={onBlur} ref={ref} />);\n      });\n      const target = createEventTarget(ref.current);\n      const body = createEventTarget(document.body);\n      act(() => {\n        target.focus();\n        body.focus({ relatedTarget: target.node });\n      });\n      expect(onBlur).toBeCalled();\n    });\n  });\n\n  describe('prop \"onChange\"', () => {\n    test('is called with the event object', () => {\n      const onChange = jest.fn();\n      const { container } = render(\n        <CheckBox onChange={onChange} value={false} />\n      );\n      const checkbox = findCheckbox(container);\n      checkbox.click(); // Needed to get ReactDOM to trigger 'change' event\n      expect(onChange).toHaveBeenCalled();\n    });\n  });\n\n  describe('prop \"onFocus\"', () => {\n    test('is called', () => {\n      const onFocus = jest.fn();\n      const ref = React.createRef();\n      act(() => {\n        render(<CheckBox onFocus={onFocus} ref={ref} />);\n      });\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.focus();\n      });\n      expect(onFocus).toBeCalled();\n    });\n  });\n\n  describe('prop \"onValueChange\"', () => {\n    test('when value is \"false\" it receives \"true\"', () => {\n      const onValueChange = jest.fn();\n      const { container } = render(\n        <CheckBox onValueChange={onValueChange} value={false} />\n      );\n      const checkbox = findCheckbox(container);\n      checkbox.click(); // Needed to get ReactDOM to trigger 'change' event\n      expect(onValueChange).toHaveBeenCalledWith(true);\n    });\n\n    test('when value is \"true\" it receives \"false\"', () => {\n      const onValueChange = jest.fn();\n      const { container } = render(\n        <CheckBox onValueChange={onValueChange} value />\n      );\n      const checkbox = findCheckbox(container);\n      checkbox.click(); // Needed to get ReactDOM to trigger 'change' event\n      expect(onValueChange).toHaveBeenCalledWith(false);\n    });\n  });\n\n  describe('prop \"ref\"', () => {\n    test('value is set', () => {\n      const ref = jest.fn();\n      render(<CheckBox ref={ref} />);\n      expect(ref).toBeCalled();\n    });\n  });\n\n  describe('prop \"style\"', () => {\n    test('value is set', () => {\n      const { container } = render(<CheckBox style={{ borderWidth: 5 }} />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"testID\"', () => {\n    test('value is set', () => {\n      const { container } = render(<CheckBox testID=\"123\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"value\"', () => {\n    test('when \"false\" an unchecked checkbox is rendered', () => {\n      const { container } = render(<CheckBox value={false} />);\n      expect(findCheckbox(container).checked).toBe(false);\n    });\n\n    test('when \"true\" a checked checkbox is rendered', () => {\n      const { container } = render(<CheckBox value />);\n      expect(findCheckbox(container).checked).toBe(true);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/CheckBox/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use client';\n\nimport type { ColorValue } from '../../types';\nimport type { ViewProps } from '../View';\n\nimport * as React from 'react';\nimport createElement from '../createElement';\nimport StyleSheet from '../StyleSheet';\nimport View from '../View';\n\ntype CheckBoxProps = {\n  ...ViewProps,\n  color?: ?ColorValue,\n  disabled?: boolean,\n  onChange?: ?(e: any) => void,\n  onValueChange?: ?(e: any) => void,\n  readOnly?: boolean,\n  value?: boolean\n};\n\nconst CheckBox: React.AbstractComponent<\n  CheckBoxProps,\n  React.ElementRef<typeof View>\n> = React.forwardRef((props, forwardedRef) => {\n  const {\n    'aria-readonly': ariaReadOnly,\n    color,\n    disabled,\n    onChange,\n    onValueChange,\n    readOnly,\n    style,\n    value,\n    ...other\n  } = props;\n\n  function handleChange(event: Object) {\n    const value = event.nativeEvent.target.checked;\n    event.nativeEvent.value = value;\n    onChange && onChange(event);\n    onValueChange && onValueChange(value);\n  }\n\n  const fakeControl = (\n    <View\n      style={[\n        styles.fakeControl,\n        value && styles.fakeControlChecked,\n        // custom color\n        value && color && { backgroundColor: color, borderColor: color },\n        disabled && styles.fakeControlDisabled,\n        value && disabled && styles.fakeControlCheckedAndDisabled\n      ]}\n    />\n  );\n\n  const nativeControl = createElement('input', {\n    checked: value,\n    disabled: disabled,\n    onChange: handleChange,\n    readOnly:\n      readOnly === true ||\n      ariaReadOnly === true ||\n      other.accessibilityReadOnly === true,\n    ref: forwardedRef,\n    style: [styles.nativeControl, styles.cursorInherit],\n    type: 'checkbox'\n  });\n\n  return (\n    <View\n      {...other}\n      aria-disabled={disabled}\n      aria-readonly={ariaReadOnly}\n      style={[styles.root, style, disabled && styles.cursorDefault]}\n    >\n      {fakeControl}\n      {nativeControl}\n    </View>\n  );\n});\n\nCheckBox.displayName = 'CheckBox';\n\nconst styles = StyleSheet.create({\n  root: {\n    cursor: 'pointer',\n    height: 16,\n    userSelect: 'none',\n    width: 16\n  },\n  cursorDefault: {\n    cursor: 'default'\n  },\n  cursorInherit: {\n    cursor: 'inherit'\n  },\n  fakeControl: {\n    alignItems: 'center',\n    backgroundColor: '#fff',\n    borderColor: '#657786',\n    borderRadius: 2,\n    borderStyle: 'solid',\n    borderWidth: 2,\n    height: '100%',\n    justifyContent: 'center',\n    width: '100%'\n  },\n  fakeControlChecked: {\n    backgroundColor: '#009688',\n    backgroundImage:\n      'url(\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmVyc2lvbj0iMS4xIgogICB2aWV3Qm94PSIwIDAgMSAxIgogICBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWluWU1pbiBtZWV0Ij4KICA8cGF0aAogICAgIGQ9Ik0gMC4wNDAzODA1OSwwLjYyNjc3NjcgMC4xNDY0NDY2MSwwLjUyMDcxMDY4IDAuNDI5Mjg5MzIsMC44MDM1NTMzOSAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IE0gMC4yMTcxNTcyOSwwLjgwMzU1MzM5IDAuODUzNTUzMzksMC4xNjcxNTcyOSAwLjk1OTYxOTQxLDAuMjczMjIzMyAwLjMyMzIyMzMsMC45MDk2MTk0MSB6IgogICAgIGlkPSJyZWN0Mzc4MCIKICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lIiAvPgo8L3N2Zz4K\")',\n    backgroundRepeat: 'no-repeat',\n    borderColor: '#009688'\n  },\n  fakeControlDisabled: {\n    borderColor: '#CCD6DD'\n  },\n  fakeControlCheckedAndDisabled: {\n    backgroundColor: '#AAB8C2',\n    borderColor: '#AAB8C2'\n  },\n  nativeControl: {\n    ...StyleSheet.absoluteFillObject,\n    height: '100%',\n    margin: 0,\n    appearance: 'none',\n    padding: 0,\n    width: '100%'\n  }\n});\n\nexport default CheckBox;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Clipboard/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use client';\n\nlet clipboardAvailable;\n\nexport default class Clipboard {\n  static isAvailable(): boolean {\n    if (clipboardAvailable === undefined) {\n      clipboardAvailable =\n        typeof document.queryCommandSupported === 'function' &&\n        document.queryCommandSupported('copy');\n    }\n    return clipboardAvailable;\n  }\n\n  static getString(): Promise<string> {\n    return Promise.resolve('');\n  }\n\n  static setString(text: string): boolean {\n    let success = false;\n    const body = document.body;\n\n    if (body) {\n      // add the text to a hidden node\n      const node = document.createElement('span');\n      node.textContent = text;\n      node.style.opacity = '0';\n      node.style.position = 'absolute';\n      node.style.whiteSpace = 'pre-wrap';\n      node.style.userSelect = 'auto';\n      body.appendChild(node);\n\n      // select the text\n      const selection = window.getSelection();\n      selection.removeAllRanges();\n      const range = document.createRange();\n      range.selectNodeContents(node);\n      selection.addRange(range);\n\n      // attempt to copy\n      try {\n        document.execCommand('copy');\n        success = true;\n      } catch (e) {}\n\n      // remove selection and node\n      selection.removeAllRanges();\n      body.removeChild(node);\n    }\n\n    return success;\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web/src/exports/DeviceEventEmitter/index.js",
    "content": "import RCTDeviceEventEmitter from '../../vendor/react-native/EventEmitter/RCTDeviceEventEmitter';\nexport default RCTDeviceEventEmitter;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Dimensions/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport Dimensions from '..';\n\ndescribe('apis/Dimensions', () => {\n  test('get', () => {\n    const handler = jest.fn();\n    Dimensions.addEventListener('change', handler);\n    expect(Dimensions.get('screen')).toMatchInlineSnapshot(`\n      {\n        \"fontScale\": 1,\n        \"height\": 0,\n        \"scale\": 1,\n        \"width\": 0,\n      }\n    `);\n    expect(Dimensions.get('window')).toMatchInlineSnapshot(`\n      {\n        \"fontScale\": 1,\n        \"height\": 768,\n        \"scale\": 1,\n        \"width\": 1024,\n      }\n    `);\n    expect(handler).toHaveBeenCalledTimes(0);\n  });\n\n  test('set', () => {\n    expect(() => Dimensions.set({})).toThrow();\n  });\n\n  test('addEventListener', () => {\n    const handler = jest.fn();\n    const subscription = Dimensions.addEventListener('change', handler);\n    window.dispatchEvent(new Event('resize'));\n    expect(handler).toHaveBeenCalledTimes(1);\n    expect(handler).toHaveBeenLastCalledWith({\n      window: Dimensions.get('window'),\n      screen: Dimensions.get('screen')\n    });\n    subscription.remove();\n    window.dispatchEvent(new Event('resize'));\n    expect(handler).toHaveBeenCalledTimes(1);\n  });\n\n  test('removeEventListener', () => {\n    const handler = jest.fn();\n    Dimensions.removeEventListener('change', handler);\n    window.dispatchEvent(new Event('resize'));\n    expect(handler).toHaveBeenCalledTimes(0);\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Dimensions/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use client';\n\nimport type { EventSubscription } from '../../vendor/react-native/vendor/emitter/EventEmitter';\nimport invariant from 'fbjs/lib/invariant';\nimport canUseDOM from '../../modules/canUseDom';\n\nexport type DisplayMetrics = {|\n  fontScale: number,\n  height: number,\n  scale: number,\n  width: number\n|};\n\ntype DimensionsValue = {|\n  window: DisplayMetrics,\n  screen: DisplayMetrics\n|};\n\ntype DimensionKey = 'window' | 'screen';\n\ntype DimensionEventListenerType = 'change';\n\nconst dimensions = {\n  window: {\n    fontScale: 1,\n    height: 0,\n    scale: 1,\n    width: 0\n  },\n  screen: {\n    fontScale: 1,\n    height: 0,\n    scale: 1,\n    width: 0\n  }\n};\nconst listeners = {};\n\nlet shouldInit = canUseDOM;\n\nfunction update() {\n  if (!canUseDOM) {\n    return;\n  }\n\n  const win = window;\n  let height;\n  let width;\n\n  /**\n   * iOS does not update viewport dimensions on keyboard open/close.\n   * window.visualViewport(https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport)\n   * is used instead of document.documentElement.clientHeight (which remains as a fallback)\n   */\n  if (win.visualViewport) {\n    const visualViewport = win.visualViewport;\n    /**\n     * We are multiplying by scale because height and width from visual viewport\n     * also react to pinch zoom, and become smaller when zoomed. But it is not desired\n     * behaviour, since originally documentElement client height and width were used,\n     * and they do not react to pinch zoom.\n     */\n    height = Math.round(visualViewport.height * visualViewport.scale);\n    width = Math.round(visualViewport.width * visualViewport.scale);\n  } else {\n    const docEl = win.document.documentElement;\n    height = docEl.clientHeight;\n    width = docEl.clientWidth;\n  }\n\n  dimensions.window = {\n    fontScale: 1,\n    height,\n    scale: win.devicePixelRatio || 1,\n    width\n  };\n\n  dimensions.screen = {\n    fontScale: 1,\n    height: win.screen.height,\n    scale: win.devicePixelRatio || 1,\n    width: win.screen.width\n  };\n}\n\nfunction handleResize() {\n  update();\n  if (Array.isArray(listeners['change'])) {\n    listeners['change'].forEach((handler) => handler(dimensions));\n  }\n}\n\nexport default class Dimensions {\n  static get(dimension: DimensionKey): DisplayMetrics {\n    if (shouldInit) {\n      shouldInit = false;\n      update();\n    }\n    invariant(dimensions[dimension], `No dimension set for key ${dimension}`);\n    return dimensions[dimension];\n  }\n\n  static set(initialDimensions: ?DimensionsValue): void {\n    if (initialDimensions) {\n      if (canUseDOM) {\n        invariant(false, 'Dimensions cannot be set in the browser');\n      } else {\n        if (initialDimensions.screen != null) {\n          dimensions.screen = initialDimensions.screen;\n        }\n        if (initialDimensions.window != null) {\n          dimensions.window = initialDimensions.window;\n        }\n      }\n    }\n  }\n\n  static addEventListener(\n    type: DimensionEventListenerType,\n    handler: (DimensionsValue) => void\n  ): EventSubscription {\n    listeners[type] = listeners[type] || [];\n    listeners[type].push(handler);\n\n    return {\n      remove: () => {\n        this.removeEventListener(type, handler);\n      }\n    };\n  }\n\n  static removeEventListener(\n    type: DimensionEventListenerType,\n    handler: (DimensionsValue) => void\n  ): void {\n    if (Array.isArray(listeners[type])) {\n      listeners[type] = listeners[type].filter(\n        (_handler) => _handler !== handler\n      );\n    }\n  }\n}\n\nif (canUseDOM) {\n  if (window.visualViewport) {\n    window.visualViewport.addEventListener('resize', handleResize, false);\n  } else {\n    window.addEventListener('resize', handleResize, false);\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Easing/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nimport Easing from '../../vendor/react-native/Animated/Easing';\nexport default Easing;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/FlatList/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use client';\n\nimport FlatList from '../../vendor/react-native/FlatList';\nexport default FlatList;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/I18nManager/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\ntype I18nManagerStatus = {\n  allowRTL: (allowRTL: boolean) => void,\n  forceRTL: (forceRTL: boolean) => void,\n  getConstants: () => Constants\n};\n\ntype Constants = {\n  isRTL: boolean\n};\n\nconst I18nManager: I18nManagerStatus = {\n  allowRTL() {\n    return;\n  },\n  forceRTL() {\n    return;\n  },\n  getConstants(): Constants {\n    return { isRTL: false };\n  }\n};\n\nexport default I18nManager;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Image/__tests__/__snapshots__/index-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`components/Image prop \"aria-label\" 1`] = `\n<div\n  aria-label=\"accessibilityLabel\"\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n    style=\"background-image: url(https://google.com/favicon.ico);\"\n  />\n  <img\n    alt=\"accessibilityLabel\"\n    class=\"css-accessibilityImage-9pa8cd\"\n    draggable=\"false\"\n    src=\"https://google.com/favicon.ico\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"blurRadius\" 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n    style=\"background-image: url(https://google.com/favicon.ico); filter: blur(5px);\"\n  />\n  <img\n    alt=\"\"\n    class=\"css-accessibilityImage-9pa8cd\"\n    draggable=\"false\"\n    src=\"https://google.com/favicon.ico\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"defaultSource\" does not override \"height\" and \"width\" styles 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n  style=\"height: 20px; width: 40px;\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n    style=\"background-image: url(https://google.com/favicon.ico);\"\n  />\n  <img\n    alt=\"\"\n    class=\"css-accessibilityImage-9pa8cd\"\n    draggable=\"false\"\n    src=\"https://google.com/favicon.ico\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"defaultSource\" sets \"height\" and \"width\" styles if missing 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n  style=\"height: 10px; width: 20px;\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n    style=\"background-image: url(https://google.com/favicon.ico);\"\n  />\n  <img\n    alt=\"\"\n    class=\"css-accessibilityImage-9pa8cd\"\n    draggable=\"false\"\n    src=\"https://google.com/favicon.ico\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"defaultSource\" sets background image when value is a string 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n    style=\"background-image: url(https://google.com/favicon.ico);\"\n  />\n  <img\n    alt=\"\"\n    class=\"css-accessibilityImage-9pa8cd\"\n    draggable=\"false\"\n    src=\"https://google.com/favicon.ico\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"defaultSource\" sets background image when value is an object 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n    style=\"background-image: url(https://google.com/favicon.ico);\"\n  />\n  <img\n    alt=\"\"\n    class=\"css-accessibilityImage-9pa8cd\"\n    draggable=\"false\"\n    src=\"https://google.com/favicon.ico\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"draggable\" 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n    style=\"background-image: url(https://google.com/favicon.ico);\"\n  />\n  <img\n    alt=\"\"\n    class=\"css-accessibilityImage-9pa8cd\"\n    draggable=\"true\"\n    src=\"https://google.com/favicon.ico\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"focusable\" 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n  tabindex=\"0\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"nativeID\" 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n  id=\"nativeID\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"resizeMode\" value \"contain\" 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-ehq7j7\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"resizeMode\" value \"cover\" 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"resizeMode\" value \"none\" 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundPosition-1mrlafo r-backgroundSize-1sxrcry\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"resizeMode\" value \"repeat\" 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundPosition-1mrlafo r-backgroundRepeat-17leim2 r-backgroundSize-1sxrcry\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"resizeMode\" value \"stretch\" 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-x3cy2q\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"resizeMode\" value \"undefined\" 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"source\" is correctly updated only when loaded if defaultSource provided 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n    style=\"background-image: url(https://testing.com/preview.jpg);\"\n  />\n  <img\n    alt=\"\"\n    class=\"css-accessibilityImage-9pa8cd\"\n    draggable=\"false\"\n    src=\"https://testing.com/preview.jpg\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"source\" is correctly updated only when loaded if defaultSource provided 2`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n    style=\"background-image: url(https://testing.com/fullSize.jpg);\"\n  />\n  <img\n    alt=\"\"\n    class=\"css-accessibilityImage-9pa8cd\"\n    draggable=\"false\"\n    src=\"https://testing.com/fullSize.jpg\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"source\" is correctly updated when missing in initial render 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n    style=\"background-image: url(https://testing.com/img.jpg);\"\n  />\n  <img\n    alt=\"\"\n    class=\"css-accessibilityImage-9pa8cd\"\n    draggable=\"false\"\n    src=\"https://testing.com/img.jpg\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"source\" is not set immediately if the image has not already been loaded 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n    style=\"background-image: url(https://google.com/favicon.ico);\"\n  />\n  <img\n    alt=\"\"\n    class=\"css-accessibilityImage-9pa8cd\"\n    draggable=\"false\"\n    src=\"https://google.com/favicon.ico\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"source\" is set immediately if the image has already been loaded 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n    style=\"background-image: url(https://google.com/favicon.ico);\"\n  />\n  <img\n    alt=\"\"\n    class=\"css-accessibilityImage-9pa8cd\"\n    draggable=\"false\"\n    src=\"https://google.com/favicon.ico\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"source\" is set immediately if the image has already been loaded 2`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n    style=\"background-image: url(https://twitter.com/favicon.ico);\"\n  />\n  <img\n    alt=\"\"\n    class=\"css-accessibilityImage-9pa8cd\"\n    draggable=\"false\"\n    src=\"https://twitter.com/favicon.ico\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"source\" is set immediately if the image was preloaded 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n    style=\"background-image: url(https://yahoo.com/favicon.ico);\"\n  />\n  <img\n    alt=\"\"\n    class=\"css-accessibilityImage-9pa8cd\"\n    draggable=\"false\"\n    src=\"https://yahoo.com/favicon.ico\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"style\" removes other unsupported View styles 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n    style=\"filter: url(#tint-55);\"\n  />\n  <svg\n    style=\"position: absolute; height: 0px; visibility: hidden; width: 0px;\"\n  >\n    <defs>\n      <filter\n        id=\"tint-55\"\n      >\n        <feflood\n          flood-color=\"blue\"\n        />\n        <fecomposite\n          in2=\"SourceAlpha\"\n          operator=\"in\"\n        />\n      </filter>\n    </defs>\n  </svg>\n</div>\n`;\n\nexports[`components/Image prop \"style\" supports \"shadow\" properties (converts to filter) 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n    style=\"filter: drop-shadow(1px 1px 0px rgba(255,0,0,1.00));\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"style\" supports static and dynamic styles 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010 pos-abs\"\n  style=\"transition-timing-function: ease-in;\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"testID\" 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n  data-testid=\"testID\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n  />\n</div>\n`;\n\nexports[`components/Image prop \"tintColor\" convert to filter 1`] = `\n<div\n  class=\"css-view-g5y9jx r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010\"\n>\n  <div\n    class=\"css-view-g5y9jx r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv\"\n    style=\"background-image: url(https://google.com/favicon.ico); filter: url(#tint-57);\"\n  />\n  <img\n    alt=\"\"\n    class=\"css-accessibilityImage-9pa8cd\"\n    draggable=\"false\"\n    src=\"https://google.com/favicon.ico\"\n  />\n  <svg\n    style=\"position: absolute; height: 0px; visibility: hidden; width: 0px;\"\n  >\n    <defs>\n      <filter\n        id=\"tint-57\"\n      >\n        <feflood\n          flood-color=\"red\"\n        />\n        <fecomposite\n          in2=\"SourceAlpha\"\n          operator=\"in\"\n        />\n      </filter>\n    </defs>\n  </svg>\n</div>\n`;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Image/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/* eslint-disable react/jsx-no-bind */\n\nimport * as AssetRegistry from '../../../modules/AssetRegistry';\nimport Image from '../';\nimport ImageLoader, { ImageUriCache } from '../../../modules/ImageLoader';\nimport PixelRatio from '../../PixelRatio';\nimport React from 'react';\nimport { act, render } from '@testing-library/react';\n\nconst originalImage = window.Image;\n\ndescribe('components/Image', () => {\n  beforeEach(() => {\n    ImageUriCache._entries = {};\n    window.Image = jest.fn(() => ({}));\n  });\n\n  afterEach(() => {\n    window.Image = originalImage;\n  });\n\n  test('prop \"aria-label\"', () => {\n    const defaultSource = { uri: 'https://google.com/favicon.ico' };\n    const { container } = render(\n      <Image aria-label=\"accessibilityLabel\" defaultSource={defaultSource} />\n    );\n    expect(container.firstChild).toMatchSnapshot();\n  });\n\n  test('prop \"blurRadius\"', () => {\n    const defaultSource = { uri: 'https://google.com/favicon.ico' };\n    const { container } = render(\n      <Image blurRadius={5} defaultSource={defaultSource} />\n    );\n    expect(container.firstChild).toMatchSnapshot();\n  });\n\n  describe('prop \"defaultSource\"', () => {\n    test('sets background image when value is an object', () => {\n      const defaultSource = { uri: 'https://google.com/favicon.ico' };\n      const { container } = render(<Image defaultSource={defaultSource} />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('sets background image when value is a string', () => {\n      // emulate require-ed asset\n      const defaultSource = 'https://google.com/favicon.ico';\n      const { container } = render(<Image defaultSource={defaultSource} />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('sets \"height\" and \"width\" styles if missing', () => {\n      const defaultSource = {\n        uri: 'https://google.com/favicon.ico',\n        height: 10,\n        width: 20\n      };\n      const { container } = render(<Image defaultSource={defaultSource} />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('does not override \"height\" and \"width\" styles', () => {\n      const defaultSource = {\n        uri: 'https://google.com/favicon.ico',\n        height: 10,\n        width: 20\n      };\n      const { container } = render(\n        <Image\n          defaultSource={defaultSource}\n          style={{ height: 20, width: 40 }}\n        />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  test('prop \"draggable\"', () => {\n    const defaultSource = { uri: 'https://google.com/favicon.ico' };\n    const { container } = render(\n      <Image defaultSource={defaultSource} draggable={true} />\n    );\n    expect(container.firstChild).toMatchSnapshot();\n  });\n\n  test('prop \"focusable\"', () => {\n    const { container } = render(<Image focusable={true} />);\n    expect(container.firstChild).toMatchSnapshot();\n  });\n\n  test('prop \"nativeID\"', () => {\n    const { container } = render(<Image nativeID=\"nativeID\" />);\n    expect(container.firstChild).toMatchSnapshot();\n  });\n\n  describe('prop \"onLoad\"', () => {\n    test('is called after image is loaded from network', () => {\n      jest.useFakeTimers();\n      ImageLoader.load = jest.fn().mockImplementation((_, onLoad, onError) => {\n        onLoad();\n      });\n      const onLoadStartStub = jest.fn();\n      const onLoadStub = jest.fn();\n      const onLoadEndStub = jest.fn();\n      render(\n        <Image\n          onLoad={onLoadStub}\n          onLoadEnd={onLoadEndStub}\n          onLoadStart={onLoadStartStub}\n          source=\"https://test.com/img.jpg\"\n        />\n      );\n      jest.runOnlyPendingTimers();\n      expect(onLoadStub).toBeCalled();\n    });\n\n    test('is called after image is loaded from cache', () => {\n      jest.useFakeTimers();\n      ImageLoader.load = jest.fn().mockImplementation((_, onLoad, onError) => {\n        onLoad();\n      });\n      const onLoadStartStub = jest.fn();\n      const onLoadStub = jest.fn();\n      const onLoadEndStub = jest.fn();\n      const uri = 'https://test.com/img.jpg';\n      ImageUriCache.add(uri);\n      render(\n        <Image\n          onLoad={onLoadStub}\n          onLoadEnd={onLoadEndStub}\n          onLoadStart={onLoadStartStub}\n          source={uri}\n        />\n      );\n      jest.runOnlyPendingTimers();\n      expect(onLoadStub).toBeCalled();\n      ImageUriCache.remove(uri);\n    });\n\n    test('is called on update if \"uri\" is different', () => {\n      const onLoadStartStub = jest.fn();\n      const onLoadStub = jest.fn();\n      const onLoadEndStub = jest.fn();\n      const { rerender } = render(\n        <Image\n          onLoad={onLoadStub}\n          onLoadEnd={onLoadEndStub}\n          onLoadStart={onLoadStartStub}\n          source={'https://test.com/img.jpg'}\n        />\n      );\n      act(() => {\n        rerender(\n          <Image\n            onLoad={onLoadStub}\n            onLoadEnd={onLoadEndStub}\n            onLoadStart={onLoadStartStub}\n            source={'https://blah.com/img.png'}\n          />\n        );\n      });\n      expect(onLoadStub.mock.calls.length).toBe(2);\n      expect(onLoadEndStub.mock.calls.length).toBe(2);\n    });\n\n    test('is not called on update if \"uri\" is the same', () => {\n      const onLoadStartStub = jest.fn();\n      const onLoadStub = jest.fn();\n      const onLoadEndStub = jest.fn();\n      const { rerender } = render(\n        <Image\n          onLoad={onLoadStub}\n          onLoadEnd={onLoadEndStub}\n          onLoadStart={onLoadStartStub}\n          source={'https://test.com/img.jpg'}\n        />\n      );\n      act(() => {\n        rerender(\n          <Image\n            onLoad={onLoadStub}\n            onLoadEnd={onLoadEndStub}\n            onLoadStart={onLoadStartStub}\n            source={'https://test.com/img.jpg'}\n          />\n        );\n      });\n      expect(onLoadStub.mock.calls.length).toBe(1);\n      expect(onLoadEndStub.mock.calls.length).toBe(1);\n    });\n\n    test('is not called on update if \"uri\" is the same and given as an object', () => {\n      const onLoadStartStub = jest.fn();\n      const onLoadStub = jest.fn();\n      const onLoadEndStub = jest.fn();\n      const { rerender } = render(\n        <Image\n          onLoad={onLoadStub}\n          onLoadEnd={onLoadEndStub}\n          onLoadStart={onLoadStartStub}\n          source={{ uri: 'https://test.com/img.jpg', width: 1, height: 1 }}\n        />\n      );\n      act(() => {\n        rerender(\n          <Image\n            onLoad={onLoadStub}\n            onLoadEnd={onLoadEndStub}\n            onLoadStart={onLoadStartStub}\n            source={{ uri: 'https://test.com/img.jpg', width: 1, height: 1 }}\n          />\n        );\n      });\n      expect(onLoadStub.mock.calls.length).toBe(1);\n      expect(onLoadEndStub.mock.calls.length).toBe(1);\n    });\n  });\n\n  describe('prop \"resizeMode\"', () => {\n    ['contain', 'cover', 'none', 'repeat', 'stretch', undefined].forEach(\n      (resizeMode) => {\n        test(`value \"${resizeMode}\"`, () => {\n          const { container } = render(<Image resizeMode={resizeMode} />);\n          expect(container.firstChild).toMatchSnapshot();\n        });\n      }\n    );\n  });\n\n  describe('prop \"source\"', () => {\n    test('does not throw', () => {\n      const sources = [\n        null,\n        '',\n        {},\n        { uri: '' },\n        { uri: 'https://google.com' }\n      ];\n      sources.forEach((source) => {\n        expect(() => render(<Image source={source} />)).not.toThrow();\n      });\n    });\n\n    test('is not set immediately if the image has not already been loaded', () => {\n      const uri = 'https://google.com/favicon.ico';\n      const source = { uri };\n      const { container } = render(<Image source={source} />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('is set immediately if the image was preloaded', () => {\n      const uri = 'https://yahoo.com/favicon.ico';\n      ImageLoader.load = jest\n        .fn()\n        .mockImplementationOnce((_, onLoad, onError) => {\n          onLoad();\n        });\n      return Image.prefetch(uri).then(() => {\n        const source = { uri };\n        const { container } = render(<Image source={source} />, {\n          disableLifecycleMethods: true\n        });\n        expect(container.firstChild).toMatchSnapshot();\n        ImageUriCache.remove(uri);\n      });\n    });\n\n    test('is set immediately if the image has already been loaded', () => {\n      const uriOne = 'https://google.com/favicon.ico';\n      const uriTwo = 'https://twitter.com/favicon.ico';\n      ImageUriCache.add(uriOne);\n      ImageUriCache.add(uriTwo);\n\n      // initial render\n      const { container, rerender } = render(\n        <Image source={{ uri: uriOne }} />\n      );\n      ImageUriCache.remove(uriOne);\n      expect(container.firstChild).toMatchSnapshot();\n      // props update\n      act(() => {\n        rerender(<Image source={{ uri: uriTwo }} />);\n        ImageUriCache.remove(uriTwo);\n      });\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('is correctly updated when missing in initial render', () => {\n      const uri = 'https://testing.com/img.jpg';\n      const { container, rerender } = render(<Image />);\n      act(() => {\n        rerender(<Image source={{ uri }} />);\n      });\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('is correctly updated only when loaded if defaultSource provided', () => {\n      const defaultUri = 'https://testing.com/preview.jpg';\n      const uri = 'https://testing.com/fullSize.jpg';\n      let loadCallback;\n      ImageLoader.load = jest\n        .fn()\n        .mockImplementationOnce((_, onLoad, onError) => {\n          loadCallback = onLoad;\n        });\n      const { container } = render(\n        <Image defaultSource={{ uri: defaultUri }} source={{ uri }} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n      act(() => {\n        loadCallback();\n      });\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('it correctly selects the source scale', () => {\n      AssetRegistry.getAssetByID = jest.fn(() => ({\n        httpServerLocation: 'static',\n        name: 'img',\n        scales: [1, 2, 3],\n        type: 'png'\n      }));\n\n      PixelRatio.get = jest.fn(() => 1.0);\n      let { container } = render(<Image source={1} />);\n      expect(container.querySelector('img').src).toBe(\n        'http://localhost/static/img.png'\n      );\n\n      act(() => {\n        PixelRatio.get = jest.fn(() => 2.2);\n        ({ container } = render(<Image source={1} />));\n      });\n      expect(container.querySelector('img').src).toBe(\n        'http://localhost/static/img@2x.png'\n      );\n    });\n  });\n\n  describe('prop \"style\"', () => {\n    test('supports \"shadow\" properties (converts to filter)', () => {\n      const { container } = render(\n        <Image\n          style={{ shadowColor: 'red', shadowOffset: { width: 1, height: 1 } }}\n        />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('removes other unsupported View styles', () => {\n      const { container } = render(\n        <Image style={{ overlayColor: 'red', tintColor: 'blue' }} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('supports static and dynamic styles', () => {\n      const { container } = render(\n        <Image\n          style={[\n            { $$css: true, position: 'pos-abs' },\n            { transitionTimingFunction: 'ease-in' }\n          ]}\n        />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"tintColor\"', () => {\n    test('convert to filter', () => {\n      const defaultSource = { uri: 'https://google.com/favicon.ico' };\n      const { container } = render(\n        <Image defaultSource={defaultSource} tintColor={'red'} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  test('prop \"testID\"', () => {\n    const { container } = render(<Image testID=\"testID\" />);\n    expect(container.firstChild).toMatchSnapshot();\n  });\n\n  test('queryCache', () => {\n    const uriOne = 'https://google.com/favicon.ico';\n    const uriTwo = 'https://twitter.com/favicon.ico';\n    ImageUriCache.add(uriOne);\n    ImageUriCache.add(uriTwo);\n    return Image.queryCache([uriOne, uriTwo, 'oops']).then((res) => {\n      expect(res).toEqual({\n        [uriOne]: 'disk/memory',\n        [uriTwo]: 'disk/memory'\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Image/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use client';\n\nimport type { ImageProps } from './types';\n\nimport * as React from 'react';\nimport createElement from '../createElement';\nimport { getAssetByID } from '../../modules/AssetRegistry';\nimport { createBoxShadowValue } from '../StyleSheet/preprocess';\nimport ImageLoader from '../../modules/ImageLoader';\nimport PixelRatio from '../PixelRatio';\nimport StyleSheet from '../StyleSheet';\nimport TextAncestorContext from '../Text/TextAncestorContext';\nimport View from '../View';\nimport { warnOnce } from '../../modules/warnOnce';\n\nexport type { ImageProps };\n\nconst ERRORED = 'ERRORED';\nconst LOADED = 'LOADED';\nconst LOADING = 'LOADING';\nconst IDLE = 'IDLE';\n\nlet _filterId = 0;\nconst svgDataUriPattern = /^(data:image\\/svg\\+xml;utf8,)(.*)/;\n\nfunction createTintColorSVG(tintColor, id) {\n  return tintColor && id != null ? (\n    <svg\n      style={{\n        position: 'absolute',\n        height: 0,\n        visibility: 'hidden',\n        width: 0\n      }}\n    >\n      <defs>\n        <filter id={`tint-${id}`} suppressHydrationWarning={true}>\n          <feFlood floodColor={`${tintColor}`} key={tintColor} />\n          <feComposite in2=\"SourceAlpha\" operator=\"in\" />\n        </filter>\n      </defs>\n    </svg>\n  ) : null;\n}\n\nfunction extractNonStandardStyleProps(\n  style,\n  blurRadius,\n  filterId,\n  tintColorProp\n) {\n  const flatStyle = StyleSheet.flatten(style);\n  const { filter, resizeMode, shadowOffset, tintColor } = flatStyle;\n\n  if (flatStyle.resizeMode) {\n    warnOnce(\n      'Image.style.resizeMode',\n      'Image: style.resizeMode is deprecated. Please use props.resizeMode.'\n    );\n  }\n  if (flatStyle.tintColor) {\n    warnOnce(\n      'Image.style.tintColor',\n      'Image: style.tintColor is deprecated. Please use props.tintColor.'\n    );\n  }\n\n  // Add CSS filters\n  // React Native exposes these features as props and proprietary styles\n  const filters = [];\n  let _filter = null;\n\n  if (filter) {\n    filters.push(filter);\n  }\n  if (blurRadius) {\n    filters.push(`blur(${blurRadius}px)`);\n  }\n  if (shadowOffset) {\n    const shadowString = createBoxShadowValue(flatStyle);\n    if (shadowString) {\n      filters.push(`drop-shadow(${shadowString})`);\n    }\n  }\n  if ((tintColorProp || tintColor) && filterId != null) {\n    filters.push(`url(#tint-${filterId})`);\n  }\n\n  if (filters.length > 0) {\n    _filter = filters.join(' ');\n  }\n\n  return [resizeMode, _filter, tintColor];\n}\n\nfunction resolveAssetDimensions(source) {\n  if (typeof source === 'number') {\n    const { height, width } = getAssetByID(source);\n    return { height, width };\n  } else if (\n    source != null &&\n    !Array.isArray(source) &&\n    typeof source === 'object'\n  ) {\n    const { height, width } = source;\n    return { height, width };\n  }\n}\n\nfunction resolveAssetUri(source): ?string {\n  let uri = null;\n  if (typeof source === 'number') {\n    // get the URI from the packager\n    const asset = getAssetByID(source);\n    if (asset == null) {\n      throw new Error(\n        `Image: asset with ID \"${source}\" could not be found. Please check the image source or packager.`\n      );\n    }\n    let scale = asset.scales[0];\n    if (asset.scales.length > 1) {\n      const preferredScale = PixelRatio.get();\n      // Get the scale which is closest to the preferred scale\n      scale = asset.scales.reduce((prev, curr) =>\n        Math.abs(curr - preferredScale) < Math.abs(prev - preferredScale)\n          ? curr\n          : prev\n      );\n    }\n    const scaleSuffix = scale !== 1 ? `@${scale}x` : '';\n    uri = asset\n      ? `${asset.httpServerLocation}/${asset.name}${scaleSuffix}.${asset.type}`\n      : '';\n  } else if (typeof source === 'string') {\n    uri = source;\n  } else if (source && typeof source.uri === 'string') {\n    uri = source.uri;\n  }\n\n  if (uri) {\n    const match = uri.match(svgDataUriPattern);\n    // inline SVG markup may contain characters (e.g., #, \") that need to be escaped\n    if (match) {\n      const [, prefix, svg] = match;\n      const encodedSvg = encodeURIComponent(svg);\n      return `${prefix}${encodedSvg}`;\n    }\n  }\n\n  return uri;\n}\n\ninterface ImageStatics {\n  getSize: (\n    uri: string,\n    success: (width: number, height: number) => void,\n    failure: () => void\n  ) => void;\n  prefetch: (uri: string) => Promise<void>;\n  queryCache: (\n    uris: Array<string>\n  ) => Promise<{| [uri: string]: 'disk/memory' |}>;\n}\n\nconst Image: React.AbstractComponent<\n  ImageProps,\n  React.ElementRef<typeof View>\n> = React.forwardRef((props, ref) => {\n  const {\n    'aria-label': _ariaLabel,\n    accessibilityLabel,\n    blurRadius,\n    defaultSource,\n    draggable,\n    onError,\n    onLayout,\n    onLoad,\n    onLoadEnd,\n    onLoadStart,\n    pointerEvents,\n    source,\n    style,\n    ...rest\n  } = props;\n  const ariaLabel = _ariaLabel || accessibilityLabel;\n\n  if (process.env.NODE_ENV !== 'production') {\n    if (props.children) {\n      throw new Error(\n        'The <Image> component cannot contain children. If you want to render content on top of the image, consider using the <ImageBackground> component or absolute positioning.'\n      );\n    }\n  }\n\n  const [state, updateState] = React.useState(() => {\n    const uri = resolveAssetUri(source);\n    if (uri != null) {\n      const isLoaded = ImageLoader.has(uri);\n      if (isLoaded) {\n        return LOADED;\n      }\n    }\n    return IDLE;\n  });\n\n  const [layout, updateLayout] = React.useState({});\n  const hasTextAncestor = React.useContext(TextAncestorContext);\n  const hiddenImageRef = React.useRef(null);\n  const filterRef = React.useRef(_filterId++);\n  const requestRef = React.useRef(null);\n  const shouldDisplaySource =\n    state === LOADED || (state === LOADING && defaultSource == null);\n  const [_resizeMode, filter, _tintColor] = extractNonStandardStyleProps(\n    style,\n    blurRadius,\n    filterRef.current,\n    props.tintColor\n  );\n  const resizeMode = props.resizeMode || _resizeMode || 'cover';\n  const tintColor = props.tintColor || _tintColor;\n  const selectedSource = shouldDisplaySource ? source : defaultSource;\n  const displayImageUri = resolveAssetUri(selectedSource);\n  const imageSizeStyle = resolveAssetDimensions(selectedSource);\n  const backgroundImage = displayImageUri ? `url(\"${displayImageUri}\")` : null;\n  const backgroundSize = getBackgroundSize();\n\n  // Accessibility image allows users to trigger the browser's image context menu\n  const hiddenImage = displayImageUri\n    ? createElement('img', {\n        alt: ariaLabel || '',\n        style: styles.accessibilityImage$raw,\n        draggable: draggable || false,\n        ref: hiddenImageRef,\n        src: displayImageUri\n      })\n    : null;\n\n  function getBackgroundSize(): ?string {\n    if (\n      hiddenImageRef.current != null &&\n      (resizeMode === 'center' || resizeMode === 'repeat')\n    ) {\n      const { naturalHeight, naturalWidth } = hiddenImageRef.current;\n      const { height, width } = layout;\n      if (naturalHeight && naturalWidth && height && width) {\n        const scaleFactor = Math.min(\n          1,\n          width / naturalWidth,\n          height / naturalHeight\n        );\n        const x = Math.ceil(scaleFactor * naturalWidth);\n        const y = Math.ceil(scaleFactor * naturalHeight);\n        return `${x}px ${y}px`;\n      }\n    }\n  }\n\n  function handleLayout(e) {\n    if (resizeMode === 'center' || resizeMode === 'repeat' || onLayout) {\n      const { layout } = e.nativeEvent;\n      onLayout && onLayout(e);\n      updateLayout(layout);\n    }\n  }\n\n  // Image loading\n  const uri = resolveAssetUri(source);\n  React.useEffect(() => {\n    abortPendingRequest();\n\n    if (uri != null) {\n      updateState(LOADING);\n      if (onLoadStart) {\n        onLoadStart();\n      }\n\n      requestRef.current = ImageLoader.load(\n        uri,\n        function load(e) {\n          updateState(LOADED);\n          if (onLoad) {\n            onLoad(e);\n          }\n          if (onLoadEnd) {\n            onLoadEnd();\n          }\n        },\n        function error() {\n          updateState(ERRORED);\n          if (onError) {\n            onError({\n              nativeEvent: {\n                error: `Failed to load resource ${uri}`\n              }\n            });\n          }\n          if (onLoadEnd) {\n            onLoadEnd();\n          }\n        }\n      );\n    }\n\n    function abortPendingRequest() {\n      if (requestRef.current != null) {\n        ImageLoader.abort(requestRef.current);\n        requestRef.current = null;\n      }\n    }\n\n    return abortPendingRequest;\n  }, [uri, requestRef, updateState, onError, onLoad, onLoadEnd, onLoadStart]);\n\n  return (\n    <View\n      {...rest}\n      aria-label={ariaLabel}\n      onLayout={handleLayout}\n      pointerEvents={pointerEvents}\n      ref={ref}\n      style={[\n        styles.root,\n        hasTextAncestor && styles.inline,\n        imageSizeStyle,\n        style,\n        styles.undo,\n        // TEMP: avoid deprecated shadow props regression\n        // until Image refactored to use createElement.\n        { boxShadow: null }\n      ]}\n    >\n      <View\n        style={[\n          styles.image,\n          resizeModeStyles[resizeMode],\n          { backgroundImage, filter },\n          backgroundSize != null && { backgroundSize }\n        ]}\n        suppressHydrationWarning={true}\n      />\n      {hiddenImage}\n      {createTintColorSVG(tintColor, filterRef.current)}\n    </View>\n  );\n});\n\nImage.displayName = 'Image';\n\n// $FlowIgnore: This is the correct type, but casting makes it unhappy since the variables aren't defined yet\nconst ImageWithStatics = (Image: React.AbstractComponent<\n  ImageProps,\n  React.ElementRef<typeof View>\n> &\n  ImageStatics);\n\nImageWithStatics.getSize = function (uri, success, failure) {\n  ImageLoader.getSize(uri, success, failure);\n};\n\nImageWithStatics.prefetch = function (uri) {\n  return ImageLoader.prefetch(uri);\n};\n\nImageWithStatics.queryCache = function (uris) {\n  return ImageLoader.queryCache(uris);\n};\n\nconst styles = StyleSheet.create({\n  root: {\n    flexBasis: 'auto',\n    overflow: 'hidden',\n    zIndex: 0\n  },\n  inline: {\n    display: 'inline-flex'\n  },\n  undo: {\n    // These styles are converted to CSS filters applied to the\n    // element displaying the background image.\n    blurRadius: null,\n    shadowColor: null,\n    shadowOpacity: null,\n    shadowOffset: null,\n    shadowRadius: null,\n    tintColor: null,\n    // These styles are not supported\n    overlayColor: null,\n    resizeMode: null\n  },\n  image: {\n    ...StyleSheet.absoluteFillObject,\n    backgroundColor: 'transparent',\n    backgroundPosition: 'center',\n    backgroundRepeat: 'no-repeat',\n    backgroundSize: 'cover',\n    height: '100%',\n    width: '100%',\n    zIndex: -1\n  },\n  accessibilityImage$raw: {\n    ...StyleSheet.absoluteFillObject,\n    height: '100%',\n    opacity: 0,\n    width: '100%',\n    zIndex: -1\n  }\n});\n\nconst resizeModeStyles = StyleSheet.create({\n  center: {\n    backgroundSize: 'auto'\n  },\n  contain: {\n    backgroundSize: 'contain'\n  },\n  cover: {\n    backgroundSize: 'cover'\n  },\n  none: {\n    backgroundPosition: '0',\n    backgroundSize: 'auto'\n  },\n  repeat: {\n    backgroundPosition: '0',\n    backgroundRepeat: 'repeat',\n    backgroundSize: 'auto'\n  },\n  stretch: {\n    backgroundSize: '100% 100%'\n  }\n});\n\nexport default ImageWithStatics;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Image/types.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport type { ColorValue, GenericStyleProp } from '../../types';\nimport type { ViewProps, ViewStyle } from '../View/types';\n\ntype SourceObject = {\n  /**\n   * `body` is the HTTP body to send with the request. This must be a valid\n   * UTF-8 string, and will be sent exactly as specified, with no\n   * additional encoding (e.g. URL-escaping or base64) applied.\n   */\n  body?: string,\n  /**\n   * `cache` determines how the requests handles potentially cached\n   * responses.\n   *\n   * - `default`: Use the native platforms default strategy. `useProtocolCachePolicy` on iOS.\n   *\n   * - `reload`: The data for the URL will be loaded from the originating source.\n   * No existing cache data should be used to satisfy a URL load request.\n   *\n   * - `force-cache`: The existing cached data will be used to satisfy the request,\n   * regardless of its age or expiration date. If there is no existing data in the cache\n   * corresponding the request, the data is loaded from the originating source.\n   *\n   * - `only-if-cached`: The existing cache data will be used to satisfy a request, regardless of\n   * its age or expiration date. If there is no existing data in the cache corresponding\n   * to a URL load request, no attempt is made to load the data from the originating source,\n   * and the load is considered to have failed.\n   *\n   * @platform ios\n   */\n  cache?: 'default' | 'reload' | 'force-cache' | 'only-if-cached',\n  /**\n   * `headers` is an object representing the HTTP headers to send along with the\n   * request for a remote image.\n   */\n  headers?: { [key: string]: string },\n  /**\n   * `method` is the HTTP Method to use. Defaults to GET if not specified.\n   */\n  method?: string,\n  /**\n   * `scale` is used to indicate the scale factor of the image. Defaults to 1.0 if\n   * unspecified, meaning that one image pixel equates to one display point / DIP.\n   */\n  scale?: number,\n  /**\n   * `uri` is a string representing the resource identifier for the image, which\n   * could be an http address, a local file path, or the name of a static image\n   * resource (which should be wrapped in the `require('./path/to/image.png')`\n   * function).\n   */\n  uri: string,\n  /**\n   * `width` and `height` can be specified if known at build time, in which case\n   * these will be used to set the default `<Image/>` component dimensions.\n   */\n  height?: number,\n  width?: number\n};\n\nexport type ResizeMode =\n  | 'center'\n  | 'contain'\n  | 'cover'\n  | 'none'\n  | 'repeat'\n  | 'stretch';\n\nexport type Source = number | string | SourceObject | Array<SourceObject>;\n\nexport type ImageStyle = {\n  ...ViewStyle,\n  // @deprecated\n  resizeMode?: ResizeMode,\n  tintColor?: ColorValue\n};\n\nexport type ImageProps = {\n  ...ViewProps,\n  blurRadius?: number,\n  defaultSource?: Source,\n  draggable?: boolean,\n  onError?: (e: any) => void,\n  onLayout?: (e: any) => void,\n  onLoad?: (e: any) => void,\n  onLoadEnd?: (e: any) => void,\n  onLoadStart?: (e: any) => void,\n  onProgress?: (e: any) => void,\n  resizeMode?: ResizeMode,\n  source?: Source,\n  style?: GenericStyleProp<ImageStyle>,\n  tintColor?: ColorValue\n};\n"
  },
  {
    "path": "packages/react-native-web/src/exports/ImageBackground/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport ImageBackground from '..';\nimport React from 'react';\nimport { render } from '@testing-library/react';\nimport Text from '../../Text';\n\nfunction findImage(container) {\n  return container.firstChild.firstChild;\n}\n\ndescribe('components/ImageBackground', () => {\n  describe('prop \"children\"', () => {\n    test('render child content', () => {\n      const { getByText } = render(\n        <ImageBackground>\n          <Text>Hello World!</Text>\n        </ImageBackground>\n      );\n      expect(getByText('Hello World!')).toBeDefined();\n    });\n  });\n\n  describe('prop \"imageStyle\"', () => {\n    test('sets the style of the underlying Image', () => {\n      const imageStyle = { width: 40, height: 60 };\n      const { container } = render(<ImageBackground imageStyle={imageStyle} />);\n      expect(\n        findImage(container)\n          .getAttribute('style')\n          .includes('width: 40px; height: 60px;')\n      ).toBe(true);\n    });\n  });\n\n  describe('prop \"style\"', () => {\n    test('sets the style of the container View', () => {\n      const style = { margin: 40 };\n      const { container } = render(<ImageBackground style={style} />);\n      expect(container.firstChild.getAttribute('style')).toEqual(\n        'margin: 40px 40px 40px 40px;'\n      );\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/ImageBackground/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport type { ImageProps } from '../Image';\nimport type { ViewProps } from '../View';\n\nimport * as React from 'react';\nimport { forwardRef } from 'react';\nimport Image from '../Image';\nimport StyleSheet from '../StyleSheet';\nimport View from '../View';\n\ntype ImageBackgroundProps = {\n  ...ImageProps,\n  imageRef?: any,\n  imageStyle?: $PropertyType<ImageProps, 'style'>,\n  style?: $PropertyType<ViewProps, 'style'>\n};\n\nconst emptyObject = {};\n\n/**\n * Very simple drop-in replacement for <Image> which supports nesting views.\n */\nconst ImageBackground: React.AbstractComponent<\n  ImageBackgroundProps,\n  React.ElementRef<typeof View>\n> = forwardRef((props, forwardedRef) => {\n  const {\n    children,\n    style = emptyObject,\n    imageStyle,\n    imageRef,\n    ...rest\n  } = props;\n  const { height, width } = StyleSheet.flatten(style);\n\n  return (\n    <View ref={forwardedRef} style={style}>\n      <Image\n        {...rest}\n        ref={imageRef}\n        style={[\n          {\n            // Temporary Workaround:\n            // Current (imperfect yet) implementation of <Image> overwrites width and height styles\n            // (which is not quite correct), and these styles conflict with explicitly set styles\n            // of <ImageBackground> and with our internal layout model here.\n            // So, we have to proxy/reapply these styles explicitly for actual <Image> component.\n            // This workaround should be removed after implementing proper support of\n            // intrinsic content size of the <Image>.\n            width,\n            height,\n            zIndex: -1\n          },\n          StyleSheet.absoluteFill,\n          imageStyle\n        ]}\n      />\n      {children}\n    </View>\n  );\n});\n\nImageBackground.displayName = 'ImageBackground';\n\nexport default ImageBackground;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/InputAccessoryView/index.js",
    "content": "import UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/InteractionManager/TaskQueue.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport invariant from 'fbjs/lib/invariant';\n\ntype SimpleTask = {|\n  name: string,\n  run: () => void\n|};\ntype PromiseTask = {|\n  name: string,\n  gen: () => Promise<void>\n|};\nexport type Task = SimpleTask | PromiseTask | (() => void);\n\nclass TaskQueue {\n  constructor({ onMoreTasks }: { onMoreTasks: () => void, ... }) {\n    this._onMoreTasks = onMoreTasks;\n    this._queueStack = [{ tasks: [], popable: true }];\n  }\n\n  enqueue(task: Task): void {\n    this._getCurrentQueue().push(task);\n  }\n\n  enqueueTasks(tasks: Array<Task>): void {\n    tasks.forEach((task) => this.enqueue(task));\n  }\n\n  cancelTasks(tasksToCancel: Array<Task>): void {\n    this._queueStack = this._queueStack\n      .map((queue) => ({\n        ...queue,\n        tasks: queue.tasks.filter((task) => tasksToCancel.indexOf(task) === -1)\n      }))\n      .filter((queue, idx) => queue.tasks.length > 0 || idx === 0);\n  }\n\n  hasTasksToProcess(): boolean {\n    return this._getCurrentQueue().length > 0;\n  }\n\n  /**\n   * Executes the next task in the queue.\n   */\n  processNext(): void {\n    const queue = this._getCurrentQueue();\n    if (queue.length) {\n      const task = queue.shift();\n      try {\n        if (typeof task === 'object' && task.gen) {\n          this._genPromise(task);\n        } else if (typeof task === 'object' && task.run) {\n          task.run();\n        } else {\n          invariant(\n            typeof task === 'function',\n            'Expected Function, SimpleTask, or PromiseTask, but got:\\n' +\n              JSON.stringify(task, null, 2)\n          );\n          task();\n        }\n      } catch (e) {\n        e.message =\n          'TaskQueue: Error with task ' + (task.name || '') + ': ' + e.message;\n        throw e;\n      }\n    }\n  }\n\n  _queueStack: Array<{\n    tasks: Array<Task>,\n    popable: boolean,\n    ...\n  }>;\n  _onMoreTasks: () => void;\n\n  _getCurrentQueue(): Array<Task> {\n    const stackIdx = this._queueStack.length - 1;\n    const queue = this._queueStack[stackIdx];\n    if (queue.popable && queue.tasks.length === 0 && stackIdx > 0) {\n      this._queueStack.pop();\n      return this._getCurrentQueue();\n    } else {\n      return queue.tasks;\n    }\n  }\n\n  _genPromise(task: PromiseTask) {\n    const length = this._queueStack.push({ tasks: [], popable: false });\n    const stackIdx = length - 1;\n    const stackItem = this._queueStack[stackIdx];\n    task\n      .gen()\n      .then(() => {\n        stackItem.popable = true;\n        this.hasTasksToProcess() && this._onMoreTasks();\n      })\n      .catch((ex) => {\n        setTimeout(() => {\n          ex.message = `TaskQueue: Error resolving Promise in task ${task.name}: ${ex.message}`;\n          throw ex;\n        }, 0);\n      });\n  }\n}\n\nexport default TaskQueue;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/InteractionManager/__tests__/TaskQueue-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nfunction expectToBeCalledOnce(fn) {\n  expect(fn.mock.calls.length).toBe(1);\n}\n\nfunction clearTaskQueue(taskQueue) {\n  do {\n    jest.runAllTimers();\n    taskQueue.processNext();\n    jest.runAllTimers();\n  } while (taskQueue.hasTasksToProcess());\n}\n\ndescribe('TaskQueue', () => {\n  let taskQueue;\n  let onMoreTasks;\n  let sequenceId;\n\n  function createSequenceTask(expectedSequenceId) {\n    return jest.fn(() => {\n      expect(++sequenceId).toBe(expectedSequenceId);\n    });\n  }\n\n  beforeEach(() => {\n    jest.resetModules();\n    onMoreTasks = jest.fn();\n    const TaskQueue = require('../TaskQueue');\n    taskQueue = new TaskQueue({ onMoreTasks });\n    sequenceId = 0;\n  });\n\n  it('should run a basic task', () => {\n    const task1 = createSequenceTask(1);\n    taskQueue.enqueue({ run: task1, name: 'run1' });\n    expect(taskQueue.hasTasksToProcess()).toBe(true);\n    taskQueue.processNext();\n    expectToBeCalledOnce(task1);\n  });\n\n  it('should handle blocking promise task', () => {\n    onMoreTasks.mockImplementation(() => {\n      taskQueue.processNext();\n      jest.runAllTimers();\n    });\n\n    const task1 = jest.fn(() => {\n      return new Promise((resolve) => {\n        setTimeout(() => {\n          expect(++sequenceId).toBe(1);\n          resolve();\n        }, 1);\n      });\n    });\n    const task2 = createSequenceTask(2);\n    taskQueue.enqueue({ gen: task1, name: 'gen1' });\n    taskQueue.enqueue({ run: task2, name: 'run2' });\n\n    taskQueue.processNext();\n\n    expectToBeCalledOnce(task1);\n    expect(task2).not.toBeCalled();\n    expect(onMoreTasks).not.toBeCalled();\n    expect(taskQueue.hasTasksToProcess()).toBe(false);\n\n    clearTaskQueue(taskQueue);\n\n    return new Promise((resolve) => {\n      setTimeout(() => {\n        resolve();\n      });\n    }).then(() => {\n      expectToBeCalledOnce(onMoreTasks);\n      expectToBeCalledOnce(task2);\n    });\n  });\n\n  it('should handle nested simple tasks', () => {\n    const task1 = jest.fn(() => {\n      expect(++sequenceId).toBe(1);\n      taskQueue.enqueue({ run: task3, name: 'run3' });\n    });\n    const task2 = createSequenceTask(2);\n    const task3 = createSequenceTask(3);\n    taskQueue.enqueue({ run: task1, name: 'run1' });\n    taskQueue.enqueue({ run: task2, name: 'run2' }); // not blocked by task 1\n\n    clearTaskQueue(taskQueue);\n\n    expectToBeCalledOnce(task1);\n    expectToBeCalledOnce(task2);\n    expectToBeCalledOnce(task3);\n  });\n\n  it('should handle nested promises', () => {\n    onMoreTasks.mockImplementation(() => {\n      taskQueue.processNext();\n      jest.runAllTimers();\n    });\n\n    const task1 = jest.fn(() => {\n      return new Promise((resolve) => {\n        setTimeout(() => {\n          expect(++sequenceId).toBe(1);\n          taskQueue.enqueue({ gen: task2, name: 'gen2' });\n          taskQueue.enqueue({ run: resolve, name: 'resolve1' });\n        }, 1);\n      });\n    });\n    const task2 = jest.fn(() => {\n      return new Promise((resolve) => {\n        setTimeout(() => {\n          expect(++sequenceId).toBe(2);\n          taskQueue.enqueue({ run: task3, name: 'run3' });\n          taskQueue.enqueue({ run: resolve, name: 'resolve2' });\n        }, 1);\n      });\n    });\n    const task3 = createSequenceTask(3);\n    const task4 = createSequenceTask(4);\n    taskQueue.enqueue({ gen: task1, name: 'gen1' });\n    taskQueue.enqueue({ run: task4, name: 'run4' }); // blocked by task 1 promise\n\n    clearTaskQueue(taskQueue);\n\n    return new Promise((resolve) => {\n      setTimeout(() => {\n        resolve();\n      });\n    }).then(() => {\n      expectToBeCalledOnce(task1);\n      expectToBeCalledOnce(task2);\n      expectToBeCalledOnce(task3);\n      expectToBeCalledOnce(task4);\n    });\n  });\n\n  it('should be able to cancel tasks', () => {\n    const task1 = jest.fn();\n    const task2 = createSequenceTask(1);\n    const task3 = jest.fn();\n    const task4 = createSequenceTask(2);\n    taskQueue.enqueue(task1);\n    taskQueue.enqueue(task2);\n    taskQueue.enqueue(task3);\n    taskQueue.enqueue(task4);\n    taskQueue.cancelTasks([task1, task3]);\n    clearTaskQueue(taskQueue);\n    expect(task1).not.toBeCalled();\n    expect(task3).not.toBeCalled();\n    expectToBeCalledOnce(task2);\n    expectToBeCalledOnce(task4);\n    expect(taskQueue.hasTasksToProcess()).toBe(false);\n  });\n\n  it('should not crash when last task is cancelled', () => {\n    const task1 = jest.fn();\n    taskQueue.enqueue(task1);\n    taskQueue.cancelTasks([task1]);\n    clearTaskQueue(taskQueue);\n    expect(task1).not.toBeCalled();\n    expect(taskQueue.hasTasksToProcess()).toBe(false);\n  });\n\n  it('should not crash when task is cancelled between being started and resolved', () => {\n    const task1 = jest.fn(() => {\n      return new Promise((resolve) => {\n        setTimeout(() => {\n          resolve();\n        }, 1);\n      });\n    });\n\n    taskQueue.enqueue({ gen: task1, name: 'gen1' });\n    taskQueue.processNext();\n    taskQueue.cancelTasks([task1]);\n    jest.runAllTimers();\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/InteractionManager/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nfunction expectToBeCalledOnce(fn) {\n  expect(fn.mock.calls.length).toBe(1);\n}\n\ndescribe('InteractionManager', () => {\n  let InteractionManager;\n  let interactionStart;\n  let interactionComplete;\n\n  beforeEach(() => {\n    jest.resetModules();\n    InteractionManager = require('..');\n\n    interactionStart = jest.fn();\n    interactionComplete = jest.fn();\n\n    InteractionManager.addListener(\n      InteractionManager.Events.interactionStart,\n      interactionStart\n    );\n\n    InteractionManager.addListener(\n      InteractionManager.Events.interactionComplete,\n      interactionComplete\n    );\n  });\n\n  it('throws when clearing an undefined handle', () => {\n    expect(() => InteractionManager.clearInteractionHandle()).toThrow();\n  });\n\n  it('notifies asynchronously when interaction starts', () => {\n    InteractionManager.createInteractionHandle();\n    expect(interactionStart).not.toBeCalled();\n\n    jest.runAllTimers();\n    expect(interactionStart).toBeCalled();\n    expect(interactionComplete).not.toBeCalled();\n  });\n\n  it('notifies asynchronously when interaction stops', () => {\n    const handle = InteractionManager.createInteractionHandle();\n    jest.runAllTimers();\n    interactionStart.mockClear();\n    InteractionManager.clearInteractionHandle(handle);\n    expect(interactionComplete).not.toBeCalled();\n\n    jest.runAllTimers();\n    expect(interactionStart).not.toBeCalled();\n    expect(interactionComplete).toBeCalled();\n  });\n\n  it('does not notify when started & stoped in same event loop', () => {\n    const handle = InteractionManager.createInteractionHandle();\n    InteractionManager.clearInteractionHandle(handle);\n\n    jest.runAllTimers();\n    expect(interactionStart).not.toBeCalled();\n    expect(interactionComplete).not.toBeCalled();\n  });\n\n  it('does not notify when going from two -> one active interactions', () => {\n    InteractionManager.createInteractionHandle();\n    const handle = InteractionManager.createInteractionHandle();\n    jest.runAllTimers();\n\n    interactionStart.mockClear();\n    interactionComplete.mockClear();\n\n    InteractionManager.clearInteractionHandle(handle);\n    jest.runAllTimers();\n    expect(interactionStart).not.toBeCalled();\n    expect(interactionComplete).not.toBeCalled();\n  });\n\n  it('run tasks asynchronously when there are interactions', () => {\n    const task = jest.fn();\n    InteractionManager.runAfterInteractions(task);\n    expect(task).not.toBeCalled();\n\n    jest.runAllTimers();\n    expect(task).toBeCalled();\n  });\n\n  it('runs tasks when interactions complete', () => {\n    const task = jest.fn();\n    const handle = InteractionManager.createInteractionHandle();\n    InteractionManager.runAfterInteractions(task);\n\n    jest.runAllTimers();\n    InteractionManager.clearInteractionHandle(handle);\n    expect(task).not.toBeCalled();\n\n    jest.runAllTimers();\n    expect(task).toBeCalled();\n  });\n\n  it('does not run tasks twice', () => {\n    const task1 = jest.fn();\n    const task2 = jest.fn();\n    InteractionManager.runAfterInteractions(task1);\n    jest.runAllTimers();\n\n    InteractionManager.runAfterInteractions(task2);\n    jest.runAllTimers();\n\n    expectToBeCalledOnce(task1);\n  });\n\n  it('runs tasks added while processing previous tasks', () => {\n    const task1 = jest.fn(() => {\n      InteractionManager.runAfterInteractions(task2);\n    });\n    const task2 = jest.fn();\n\n    InteractionManager.runAfterInteractions(task1);\n    expect(task2).not.toBeCalled();\n\n    jest.runAllTimers();\n\n    expect(task1).toBeCalled();\n    expect(task2).toBeCalled();\n  });\n\n  it('allows tasks to be cancelled', () => {\n    const task1 = jest.fn();\n    const task2 = jest.fn();\n    const promise1 = InteractionManager.runAfterInteractions(task1);\n    InteractionManager.runAfterInteractions(task2);\n    expect(task1).not.toBeCalled();\n    expect(task2).not.toBeCalled();\n    promise1.cancel();\n\n    jest.runAllTimers();\n    expect(task1).not.toBeCalled();\n    expect(task2).toBeCalled();\n  });\n\n  it('should support promise variant', () => {\n    expect.assertions(1);\n    const task = jest.fn();\n    const promise = InteractionManager.runAfterInteractions()\n      .done(task)\n      .then(() => {\n        expect(task).toBeCalled();\n      });\n    jest.runAllTimers();\n    return promise;\n  });\n});\n\ndescribe('promise tasks', () => {\n  let InteractionManager;\n  let sequenceId;\n\n  function createSequenceTask(expectedSequenceId) {\n    return jest.fn(() => {\n      expect(++sequenceId).toBe(expectedSequenceId);\n    });\n  }\n\n  beforeEach(() => {\n    jest.resetModules();\n    InteractionManager = require('..');\n    sequenceId = 0;\n  });\n\n  it('should run a basic promise task', () => {\n    const task1 = jest.fn(() => {\n      expect(++sequenceId).toBe(1);\n      return new Promise((resolve) => resolve());\n    });\n    InteractionManager.runAfterInteractions({ gen: task1, name: 'gen1' });\n    jest.runAllTimers();\n    expectToBeCalledOnce(task1);\n  });\n\n  it('should handle nested promises', () => {\n    const task1 = jest.fn(() => {\n      expect(++sequenceId).toBe(1);\n      return new Promise((resolve) => {\n        InteractionManager.runAfterInteractions({\n          gen: task2,\n          name: 'gen2'\n        }).then(resolve);\n      });\n    });\n    const task2 = jest.fn(() => {\n      expect(++sequenceId).toBe(2);\n      return new Promise((resolve) => resolve());\n    });\n    InteractionManager.runAfterInteractions({ gen: task1, name: 'gen1' });\n    jest.runAllTimers();\n    expectToBeCalledOnce(task1);\n    expectToBeCalledOnce(task2);\n  });\n\n  it('should pause promise tasks during interactions then resume', () => {\n    const task1 = createSequenceTask(1);\n    const task2 = jest.fn(() => {\n      expect(++sequenceId).toBe(2);\n      return new Promise((resolve) => {\n        setTimeout(() => {\n          InteractionManager.runAfterInteractions(task3).then(resolve);\n        }, 1);\n      });\n    });\n    const task3 = createSequenceTask(3);\n    InteractionManager.runAfterInteractions(task1);\n    InteractionManager.runAfterInteractions({ gen: task2, name: 'gen2' });\n    jest.runOnlyPendingTimers();\n    expectToBeCalledOnce(task1);\n    expectToBeCalledOnce(task2);\n    const handle = InteractionManager.createInteractionHandle();\n    jest.runAllTimers();\n    jest.runAllTimers(); // Just to be sure...\n    expect(task3).not.toBeCalled();\n    InteractionManager.clearInteractionHandle(handle);\n    jest.runAllTimers();\n    expectToBeCalledOnce(task3);\n  });\n\n  it('should execute tasks in loop within deadline', () => {\n    InteractionManager.setDeadline(100);\n    const task1 = createSequenceTask(1);\n    const task2 = createSequenceTask(2);\n    InteractionManager.runAfterInteractions(task1);\n    InteractionManager.runAfterInteractions(task2);\n\n    jest.runOnlyPendingTimers();\n    expectToBeCalledOnce(task1);\n    expectToBeCalledOnce(task2);\n  });\n\n  it('should execute tasks one at a time if deadline exceeded', () => {\n    InteractionManager.setDeadline(100);\n    const task1 = jest.fn(() => {\n      expect(++sequenceId).toBe(1);\n      jest.setSystemTime(Date.now() + 200);\n    });\n    const task2 = createSequenceTask(2);\n    InteractionManager.runAfterInteractions(task1);\n    InteractionManager.runAfterInteractions(task2);\n\n    jest.runOnlyPendingTimers();\n\n    expectToBeCalledOnce(task1);\n    expect(task2).not.toBeCalled();\n\n    jest.runOnlyPendingTimers();\n\n    expectToBeCalledOnce(task2);\n  });\n\n  const bigAsyncTest = (resolveTest) => {\n    const task1 = createSequenceTask(1);\n    const task2 = jest.fn(() => {\n      expect(++sequenceId).toBe(2);\n      return new Promise((resolve) => {\n        InteractionManager.runAfterInteractions(task3);\n        setTimeout(() => {\n          InteractionManager.runAfterInteractions({\n            gen: task4,\n            name: 'gen4'\n          })\n            .then(resolve)\n            .then(() => {\n              // Explicit exhaustion of the task queue is required\n              jest.runAllTimers();\n            });\n        }, 1);\n      });\n    });\n    const task3 = createSequenceTask(3);\n    const task4 = jest.fn(() => {\n      expect(++sequenceId).toBe(4);\n      return new Promise((resolve) => {\n        InteractionManager.runAfterInteractions(task5)\n          .then(resolve)\n          .then(() => {\n            // Explicit exhaustion of the task queue is required\n            jest.runAllTimers();\n          });\n      });\n    });\n    const task5 = createSequenceTask(5);\n    const task6 = createSequenceTask(6);\n\n    InteractionManager.runAfterInteractions(task1);\n    InteractionManager.runAfterInteractions({ gen: task2, name: 'gen2' });\n    InteractionManager.runAfterInteractions(task6).then(() => {\n      expectToBeCalledOnce(task1);\n      expectToBeCalledOnce(task2);\n      expectToBeCalledOnce(task3);\n      expectToBeCalledOnce(task4);\n      expectToBeCalledOnce(task5);\n      expectToBeCalledOnce(task6);\n      resolveTest();\n    });\n\n    jest.runAllTimers();\n  };\n\n  it('resolves async tasks recursively before other queued tasks', () => {\n    return new Promise(bigAsyncTest);\n  });\n\n  it('should also work with a deadline', () => {\n    InteractionManager.setDeadline(100);\n    const task = jest.fn(() => {\n      jest.setSystemTime(Date.now() + 200);\n    });\n    InteractionManager.runAfterInteractions(task);\n    return new Promise(bigAsyncTest);\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/InteractionManager/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport invariant from 'fbjs/lib/invariant';\nimport type { Task } from './TaskQueue';\nimport TaskQueue from './TaskQueue';\nimport type { EventSubscription } from '../../vendor/react-native/vendor/emitter/EventEmitter';\nimport EventEmitter from '../../vendor/react-native/vendor/emitter/EventEmitter';\nimport requestIdleCallback from '../../modules/requestIdleCallback';\n\nconst _emitter = new EventEmitter<{\n  interactionComplete: [],\n  interactionStart: []\n}>();\n\nconst InteractionManager = {\n  Events: {\n    interactionStart: 'interactionStart',\n    interactionComplete: 'interactionComplete'\n  },\n\n  /**\n   * Schedule a function to run after all interactions have completed.\n   */\n  runAfterInteractions(task: ?Task): {\n    then: Function,\n    done: Function,\n    cancel: Function\n  } {\n    const tasks: Array<Task> = [];\n    const promise = new Promise((resolve) => {\n      _scheduleUpdate();\n      if (task) {\n        tasks.push(task);\n      }\n      tasks.push({\n        run: resolve,\n        name: 'resolve ' + ((task && task.name) || '?')\n      });\n      _taskQueue.enqueueTasks(tasks);\n    });\n    return {\n      then: promise.then.bind(promise),\n      done: promise.then.bind(promise),\n      cancel: () => {\n        _taskQueue.cancelTasks(tasks);\n      }\n    };\n  },\n\n  /**\n   * Notify manager that an interaction has started.\n   */\n  createInteractionHandle(): number {\n    _scheduleUpdate();\n    const handle = ++_inc;\n    _addInteractionSet.add(handle);\n    return handle;\n  },\n\n  /**\n   * Notify manager that an interaction has completed.\n   */\n  clearInteractionHandle(handle: number) {\n    invariant(!!handle, 'Must provide a handle to clear.');\n    _scheduleUpdate();\n    _addInteractionSet.delete(handle);\n    _deleteInteractionSet.add(handle);\n  },\n\n  addListener: (_emitter.addListener.bind(_emitter): EventSubscription),\n\n  /**\n   *\n   * @param deadline\n   */\n  setDeadline(deadline: number) {\n    _deadline = deadline;\n  }\n};\n\nconst _interactionSet = new Set();\nconst _addInteractionSet = new Set();\nconst _deleteInteractionSet = new Set();\nconst _taskQueue = new TaskQueue({ onMoreTasks: _scheduleUpdate });\nlet _nextUpdateHandle: TimeoutID | number = 0;\nlet _inc = 0;\nlet _deadline = -1;\n\n/**\n * Schedule an asynchronous update to the interaction state.\n */\nfunction _scheduleUpdate() {\n  if (!_nextUpdateHandle) {\n    if (_deadline > 0) {\n      _nextUpdateHandle = setTimeout(_processUpdate);\n    } else {\n      _nextUpdateHandle = requestIdleCallback(_processUpdate);\n    }\n  }\n}\n\n/**\n * Notify listeners, process queue, etc\n */\nfunction _processUpdate() {\n  _nextUpdateHandle = 0;\n  const interactionCount = _interactionSet.size;\n  _addInteractionSet.forEach((handle) => _interactionSet.add(handle));\n  _deleteInteractionSet.forEach((handle) => _interactionSet.delete(handle));\n  const nextInteractionCount = _interactionSet.size;\n\n  if (interactionCount !== 0 && nextInteractionCount === 0) {\n    _emitter.emit(InteractionManager.Events.interactionComplete);\n  } else if (interactionCount === 0 && nextInteractionCount !== 0) {\n    _emitter.emit(InteractionManager.Events.interactionStart);\n  }\n\n  if (nextInteractionCount === 0) {\n    // It seems that we can't know the running time of the current event loop,\n    // we can only calculate the running time of the current task queue.\n    const begin = Date.now();\n    while (_taskQueue.hasTasksToProcess()) {\n      _taskQueue.processNext();\n      if (_deadline > 0 && Date.now() - begin >= _deadline) {\n        _scheduleUpdate();\n        break;\n      }\n    }\n  }\n  _addInteractionSet.clear();\n  _deleteInteractionSet.clear();\n}\n\nexport default InteractionManager;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Keyboard/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport dismissKeyboard from '../../modules/dismissKeyboard';\n\n// in the future we can use https://github.com/w3c/virtual-keyboard\nconst Keyboard = {\n  isVisible(): boolean {\n    return false;\n  },\n  addListener(): {| remove: () => void |} {\n    return { remove: () => {} };\n  },\n  dismiss() {\n    dismissKeyboard();\n  },\n  removeAllListeners() {},\n  removeListener() {}\n};\n\nexport default Keyboard;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/KeyboardAvoidingView/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use client';\n\nimport type { LayoutEvent, LayoutValue } from '../../types';\nimport type { ViewProps } from '../View';\n\nimport * as React from 'react';\nimport View from '../View';\n\ntype KeyboardAvoidingViewProps = {\n  ...ViewProps,\n  behavior?: 'height' | 'padding' | 'position',\n  contentContainerStyle?: $PropertyType<ViewProps, 'style'>,\n  keyboardVerticalOffset: number\n};\n\nclass KeyboardAvoidingView extends React.Component<KeyboardAvoidingViewProps> {\n  frame: ?LayoutValue = null;\n\n  relativeKeyboardHeight(keyboardFrame: Object): number {\n    const frame = this.frame;\n    if (!frame || !keyboardFrame) {\n      return 0;\n    }\n    const keyboardY =\n      keyboardFrame.screenY - (this.props.keyboardVerticalOffset || 0);\n    return Math.max(frame.y + frame.height - keyboardY, 0);\n  }\n\n  onKeyboardChange(event: Object) {}\n\n  onLayout: (event: LayoutEvent) => void = (event: LayoutEvent) => {\n    this.frame = event.nativeEvent.layout;\n  };\n\n  render(): React.Node {\n    const {\n      /* eslint-disable */\n      behavior,\n      contentContainerStyle,\n      keyboardVerticalOffset,\n      /* eslint-enable */\n      ...rest\n    } = this.props;\n\n    return <View onLayout={this.onLayout} {...rest} />;\n  }\n}\n\nexport default KeyboardAvoidingView;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/LayoutAnimation/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport LayoutAnimation from '../../vendor/react-native/LayoutAnimation';\nexport default LayoutAnimation;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Linking/__tests__/index-test.js",
    "content": "/* eslint-env jasmine, jest */\n\nimport Linking from '..';\n\ndescribe('apis/Linking', () => {\n  describe('openURL', () => {\n    test('calls open with a url and target', (done) => {\n      jest\n        .spyOn(window, 'open')\n        .mockImplementationOnce((url, target, opener) => {\n          expect(url).toBe('http://foo.com/');\n          expect(target).toBe('target_name');\n          expect(opener).toBe('noopener');\n          done();\n        });\n      Linking.openURL('http://foo.com', 'target_name');\n    });\n\n    test('defaults target to _blank if not provided', (done) => {\n      jest\n        .spyOn(window, 'open')\n        .mockImplementationOnce((url, target, opener) => {\n          expect(url).toBe('http://foo.com/');\n          expect(target).toBe('_blank');\n          expect(opener).toBe('noopener');\n          done();\n        });\n      Linking.openURL('http://foo.com');\n    });\n\n    test('accepts undefined as a target', (done) => {\n      jest\n        .spyOn(window, 'open')\n        .mockImplementationOnce((url, target, opener) => {\n          expect(url).toBe('http://foo.com/');\n          expect(target).toBe(undefined);\n          expect(opener).toBe('noopener');\n          done();\n        });\n      Linking.openURL('http://foo.com', undefined);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Linking/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport invariant from 'fbjs/lib/invariant';\nimport canUseDOM from '../../modules/canUseDom';\n\nconst initialURL = canUseDOM ? window.location.href : '';\n\ntype Callback = (...args: any) => void;\n\nclass Linking {\n  /**\n   * An object mapping of event name\n   * and all the callbacks subscribing to it\n   */\n  _eventCallbacks: { [key: string]: Array<Callback> } = {};\n\n  _dispatchEvent(event: string, ...data: any) {\n    const listeners = this._eventCallbacks[event];\n    if (listeners != null && Array.isArray(listeners)) {\n      listeners.map((listener) => {\n        listener(...data);\n      });\n    }\n  }\n\n  /**\n   * Adds a event listener for the specified event. The callback will be called when the\n   * said event is dispatched.\n   */\n  addEventListener(\n    eventType: string,\n    callback: Callback\n  ): {| remove(): void |} {\n    const _this = this;\n\n    if (!_this._eventCallbacks[eventType]) {\n      _this._eventCallbacks[eventType] = [callback];\n    }\n    _this._eventCallbacks[eventType].push(callback);\n\n    return {\n      remove() {\n        const callbacks = _this._eventCallbacks[eventType];\n        const filteredCallbacks = callbacks.filter(\n          (c) => c.toString() !== callback.toString()\n        );\n        _this._eventCallbacks[eventType] = filteredCallbacks;\n      }\n    };\n  }\n\n  /**\n   * Removes a previously added event listener for the specified event. The callback must\n   * be the same object as the one passed to `addEventListener`.\n   */\n  removeEventListener(eventType: string, callback: Callback): void {\n    console.error(\n      `Linking.removeEventListener('${eventType}', ...): Method has been ` +\n        'deprecated. Please instead use `remove()` on the subscription ' +\n        'returned by `Linking.addEventListener`.'\n    );\n    const callbacks = this._eventCallbacks[eventType];\n    const filteredCallbacks = callbacks.filter(\n      (c) => c.toString() !== callback.toString()\n    );\n    this._eventCallbacks[eventType] = filteredCallbacks;\n  }\n\n  canOpenURL(): Promise<boolean> {\n    return Promise.resolve(true);\n  }\n\n  getInitialURL(): Promise<string> {\n    return Promise.resolve(initialURL);\n  }\n\n  /**\n   * Try to open the given url in a secure fashion. The method returns a Promise object.\n   * If a target is passed (including undefined) that target will be used, otherwise '_blank'.\n   * If the url opens, the promise is resolved. If not, the promise is rejected.\n   * Dispatches the `onOpen` event if `url` is opened successfully.\n   */\n  openURL(url: string, target?: string): Promise<Object | void> {\n    if (arguments.length === 1) {\n      target = '_blank';\n    }\n    try {\n      open(url, target);\n      this._dispatchEvent('onOpen', url);\n      return Promise.resolve();\n    } catch (e) {\n      return Promise.reject(e);\n    }\n  }\n\n  _validateURL(url: string) {\n    invariant(\n      typeof url === 'string',\n      'Invalid URL: should be a string. Was: ' + url\n    );\n    invariant(url, 'Invalid URL: cannot be empty');\n  }\n}\n\nconst open = (url, target) => {\n  if (canUseDOM) {\n    const urlToOpen = new URL(url, window.location).toString();\n    if (urlToOpen.indexOf('tel:') === 0) {\n      window.location = urlToOpen;\n    } else {\n      window.open(urlToOpen, target, 'noopener');\n    }\n  }\n};\n\nexport default (new Linking(): Linking);\n"
  },
  {
    "path": "packages/react-native-web/src/exports/LogBox/index.js",
    "content": "/**\n * Copyright (c) 2016-present, Nicolas Gallagher.\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 * @flow\n */\n\nconst LogBox = {\n  ignoreLogs() {},\n  ignoreAllLogs() {},\n  uninstall() {},\n  install() {}\n};\n\nexport default LogBox;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Modal/ModalAnimation.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport * as React from 'react';\nimport StyleSheet from '../StyleSheet';\nimport createElement from '../createElement';\n\nconst ANIMATION_DURATION = 250;\n\nfunction getAnimationStyle(animationType, visible) {\n  if (animationType === 'slide') {\n    return visible ? animatedSlideInStyles : animatedSlideOutStyles;\n  }\n  if (animationType === 'fade') {\n    return visible ? animatedFadeInStyles : animatedFadeOutStyles;\n  }\n  return visible ? styles.container : styles.hidden;\n}\n\nexport type ModalAnimationProps = {|\n  animationType?: ?('none' | 'slide' | 'fade'),\n  children?: any,\n  onDismiss?: ?() => void,\n  onShow?: ?() => void,\n  visible?: ?boolean\n|};\n\nfunction ModalAnimation(props: ModalAnimationProps): React.Node {\n  const { animationType, children, onDismiss, onShow, visible } = props;\n\n  const [isRendering, setIsRendering] = React.useState(false);\n  const wasVisible = React.useRef(false);\n  const wasRendering = React.useRef(false);\n\n  const isAnimated = animationType && animationType !== 'none';\n\n  const animationEndCallback = React.useCallback(\n    (e: any) => {\n      if (e && e.currentTarget !== e.target) {\n        // If the event was generated for something NOT this element we\n        // should ignore it as it's not relevant to us\n        return;\n      }\n\n      if (visible) {\n        if (onShow) {\n          onShow();\n        }\n      } else {\n        setIsRendering(false);\n      }\n    },\n    [onShow, visible]\n  );\n\n  React.useEffect(() => {\n    if (wasRendering.current && !isRendering && onDismiss) {\n      onDismiss();\n    }\n    wasRendering.current = isRendering;\n  }, [isRendering, onDismiss]);\n\n  React.useEffect(() => {\n    if (visible) {\n      setIsRendering(true);\n    }\n    if (visible !== wasVisible.current && !isAnimated) {\n      // Manually call `animationEndCallback` if no animation is used\n      animationEndCallback();\n    }\n    wasVisible.current = visible;\n  }, [isAnimated, visible, animationEndCallback]);\n\n  return isRendering || visible\n    ? createElement('div', {\n        style: isRendering\n          ? getAnimationStyle(animationType, visible)\n          : styles.hidden,\n        onAnimationEnd: animationEndCallback,\n        children\n      })\n    : null;\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    position: 'fixed',\n    top: 0,\n    right: 0,\n    bottom: 0,\n    left: 0,\n    zIndex: 9999\n  },\n  animatedIn: {\n    animationDuration: `${ANIMATION_DURATION}ms`,\n    animationTimingFunction: 'cubic-bezier(0.215, 0.61, 0.355, 1)'\n  },\n  animatedOut: {\n    pointerEvents: 'none',\n    animationDuration: `${ANIMATION_DURATION}ms`,\n    animationTimingFunction: 'cubic-bezier(0.47, 0, 0.745, 0.715)'\n  },\n  fadeIn: {\n    opacity: 1,\n    animationKeyframes: {\n      '0%': { opacity: 0 },\n      '100%': { opacity: 1 }\n    }\n  },\n  fadeOut: {\n    opacity: 0,\n    animationKeyframes: {\n      '0%': { opacity: 1 },\n      '100%': { opacity: 0 }\n    }\n  },\n  slideIn: {\n    transform: 'translateY(0%)',\n    animationKeyframes: {\n      '0%': { transform: 'translateY(100%)' },\n      '100%': { transform: 'translateY(0%)' }\n    }\n  },\n  slideOut: {\n    transform: 'translateY(100%)',\n    animationKeyframes: {\n      '0%': { transform: 'translateY(0%)' },\n      '100%': { transform: 'translateY(100%)' }\n    }\n  },\n  hidden: {\n    opacity: 0\n  }\n});\n\nconst animatedSlideInStyles = [\n  styles.container,\n  styles.animatedIn,\n  styles.slideIn\n];\nconst animatedSlideOutStyles = [\n  styles.container,\n  styles.animatedOut,\n  styles.slideOut\n];\nconst animatedFadeInStyles = [\n  styles.container,\n  styles.animatedIn,\n  styles.fadeIn\n];\nconst animatedFadeOutStyles = [\n  styles.container,\n  styles.animatedOut,\n  styles.fadeOut\n];\n\nexport default ModalAnimation;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Modal/ModalContent.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport type { ViewProps } from '../View';\n\nimport * as React from 'react';\nimport View from '../View';\nimport StyleSheet from '../StyleSheet';\nimport canUseDOM from '../../modules/canUseDom';\n\nexport type ModalContentProps = {\n  ...ViewProps,\n  active?: ?(boolean | (() => boolean)),\n  children?: any,\n  onRequestClose?: ?() => void,\n  transparent?: ?boolean\n};\n\nconst ModalContent: React.AbstractComponent<\n  ModalContentProps,\n  React.ElementRef<typeof View>\n> = React.forwardRef((props, forwardedRef) => {\n  const { active, children, onRequestClose, transparent, ...rest } = props;\n\n  React.useEffect(() => {\n    if (canUseDOM) {\n      const closeOnEscape = (e: KeyboardEvent) => {\n        if (active && e.key === 'Escape') {\n          e.stopPropagation();\n          if (onRequestClose) {\n            onRequestClose();\n          }\n        }\n      };\n      document.addEventListener('keyup', closeOnEscape, false);\n      return () => document.removeEventListener('keyup', closeOnEscape, false);\n    }\n  }, [active, onRequestClose]);\n\n  const style = React.useMemo(() => {\n    return [\n      styles.modal,\n      transparent ? styles.modalTransparent : styles.modalOpaque\n    ];\n  }, [transparent]);\n\n  return (\n    <View\n      {...rest}\n      aria-modal={true}\n      ref={forwardedRef}\n      role={active ? 'dialog' : null}\n      style={style}\n    >\n      <View style={styles.container}>{children}</View>\n    </View>\n  );\n});\n\nconst styles = StyleSheet.create({\n  modal: {\n    position: 'fixed',\n    top: 0,\n    right: 0,\n    bottom: 0,\n    left: 0\n  },\n  modalTransparent: {\n    backgroundColor: 'transparent'\n  },\n  modalOpaque: {\n    backgroundColor: 'white'\n  },\n  container: {\n    top: 0,\n    flex: 1\n  }\n});\n\nexport default ModalContent;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Modal/ModalFocusTrap.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport * as React from 'react';\nimport View from '../View';\nimport createElement from '../createElement';\nimport StyleSheet from '../StyleSheet';\nimport UIManager from '../UIManager';\nimport canUseDOM from '../../modules/canUseDom';\n\n/**\n * This Component is used to \"wrap\" the modal we're opening\n * so that changing focus via tab will never leave the document.\n *\n * This allows us to properly trap the focus within a modal\n * even if the modal is at the start or end of a document.\n */\n\nconst FocusBracket = () => {\n  return createElement('div', {\n    role: 'none',\n    tabIndex: 0,\n    style: styles.focusBracket\n  });\n};\n\nfunction attemptFocus(element: any) {\n  if (!canUseDOM) {\n    return false;\n  }\n\n  try {\n    element.focus();\n  } catch (e) {\n    // Do nothing\n  }\n\n  return document.activeElement === element;\n}\n\nfunction focusFirstDescendant(element: any) {\n  for (let i = 0; i < element.childNodes.length; i++) {\n    const child = element.childNodes[i];\n    if (attemptFocus(child) || focusFirstDescendant(child)) {\n      return true;\n    }\n  }\n  return false;\n}\n\nfunction focusLastDescendant(element: any) {\n  for (let i = element.childNodes.length - 1; i >= 0; i--) {\n    const child = element.childNodes[i];\n    if (attemptFocus(child) || focusLastDescendant(child)) {\n      return true;\n    }\n  }\n  return false;\n}\n\nexport type ModalFocusTrapProps = {|\n  active?: boolean | (() => boolean),\n  children?: any\n|};\n\nconst ModalFocusTrap = ({\n  active,\n  children\n}: ModalFocusTrapProps): React.Node => {\n  const trapElementRef = React.useRef<?HTMLElement>();\n  const focusRef = React.useRef<{\n    trapFocusInProgress: boolean,\n    lastFocusedElement: ?HTMLElement\n  }>({\n    trapFocusInProgress: false,\n    lastFocusedElement: null\n  });\n\n  React.useEffect(() => {\n    if (canUseDOM) {\n      const trapFocus = () => {\n        // We should not trap focus if:\n        // - The modal hasn't fully initialized with an HTMLElement ref\n        // - Focus is already in the process of being trapped (e.g., we're refocusing)\n        // - isTrapActive prop being falsey tells us to do nothing\n        if (\n          trapElementRef.current == null ||\n          focusRef.current.trapFocusInProgress ||\n          !active\n        ) {\n          return;\n        }\n\n        try {\n          focusRef.current.trapFocusInProgress = true;\n          if (\n            document.activeElement instanceof Node &&\n            !trapElementRef.current.contains(document.activeElement)\n          ) {\n            // To handle keyboard focusing we can make an assumption here.\n            // If you're tabbing through the focusable elements, the previously\n            // active element will either be the first or the last.\n            // If the previously selected element is the \"first\" descendant\n            // and we're leaving it - this means that we should be looping\n            // around to the other side of the modal.\n            let hasFocused = focusFirstDescendant(trapElementRef.current);\n            if (\n              focusRef.current.lastFocusedElement === document.activeElement\n            ) {\n              hasFocused = focusLastDescendant(trapElementRef.current);\n            }\n            // If we couldn't focus a new element then we need to focus onto the trap target\n            if (\n              !hasFocused &&\n              trapElementRef.current != null &&\n              document.activeElement\n            ) {\n              UIManager.focus(trapElementRef.current);\n            }\n          }\n        } finally {\n          focusRef.current.trapFocusInProgress = false;\n        }\n        focusRef.current.lastFocusedElement = document.activeElement;\n      };\n\n      // Call the trapFocus callback at least once when this modal has been activated.\n      trapFocus();\n\n      document.addEventListener('focus', trapFocus, true);\n      return () => document.removeEventListener('focus', trapFocus, true);\n    }\n  }, [active]);\n\n  // To be fully compliant with WCAG we need to refocus element that triggered opening modal\n  // after closing it\n  React.useEffect(function () {\n    if (canUseDOM) {\n      const lastFocusedElementOutsideTrap = document.activeElement;\n      return function () {\n        if (\n          lastFocusedElementOutsideTrap &&\n          document.contains(lastFocusedElementOutsideTrap)\n        ) {\n          UIManager.focus(lastFocusedElementOutsideTrap);\n        }\n      };\n    }\n  }, []);\n\n  return (\n    <>\n      <FocusBracket />\n      <View ref={trapElementRef}>{children}</View>\n      <FocusBracket />\n    </>\n  );\n};\n\nexport default ModalFocusTrap;\n\nconst styles = StyleSheet.create({\n  focusBracket: {\n    outlineStyle: 'none'\n  }\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Modal/ModalPortal.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport canUseDOM from '../../modules/canUseDom';\n\nexport type ModalPortalProps = {|\n  children: any\n|};\n\nfunction ModalPortal(props: ModalPortalProps): React.Node {\n  const { children } = props;\n  const elementRef = React.useRef(null);\n\n  if (canUseDOM && !elementRef.current) {\n    const element = document.createElement('div');\n\n    if (element && document.body) {\n      document.body.appendChild(element);\n      elementRef.current = element;\n    }\n  }\n\n  React.useEffect(() => {\n    if (canUseDOM) {\n      return () => {\n        if (document.body && elementRef.current) {\n          document.body.removeChild(elementRef.current);\n          elementRef.current = null;\n        }\n      };\n    }\n  }, []);\n\n  return elementRef.current && canUseDOM\n    ? createPortal(children, elementRef.current)\n    : null;\n}\n\nexport default ModalPortal;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Modal/__tests__/__snapshots__/index-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`components/Modal forwards props 1`] = `\n<div\n  aria-label=\"label\"\n  aria-labelledby=\"labelledby\"\n  aria-modal=\"true\"\n  class=\"css-view-g5y9jx r-bottom-1p0dtai r-left-1d2f490 r-position-1xcajam r-right-zchlnj r-top-ipm5af r-backgroundColor-14lw9ot\"\n  data-testid=\"root\"\n  role=\"dialog\"\n>\n  <div\n    class=\"css-view-g5y9jx r-flex-13awgt0 r-top-ipm5af\"\n  />\n</div>\n`;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Modal/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport Modal from '..';\nimport React from 'react';\nimport { fireEvent, render } from '@testing-library/react';\n\ndescribe('components/Modal', () => {\n  test('visible by default', () => {\n    const { getByTestId } = render(\n      <Modal>\n        <a data-testid={'inside'} href={'#hello'}>\n          Hello\n        </a>\n      </Modal>\n    );\n    const insideElement = getByTestId('inside');\n    expect(insideElement).not.toBeNull();\n    expect(insideElement).not.toBe(document.body);\n  });\n\n  test('forwards props', () => {\n    const { getByTestId } = render(\n      <Modal\n        accessibilityLabel=\"label\"\n        accessibilityLabelledBy=\"labelledby\"\n        testID=\"root\"\n      />\n    );\n    expect(getByTestId('root')).toMatchSnapshot();\n  });\n\n  test('render children when visible', () => {\n    const { getByTestId } = render(\n      <Modal visible={true}>\n        <a data-testid={'inside'} href={'#hello'}>\n          Hello\n        </a>\n      </Modal>\n    );\n    const insideElement = getByTestId('inside');\n    expect(insideElement).not.toBeNull();\n    expect(insideElement).not.toBe(document.body);\n  });\n\n  test('does not render children when not visible', () => {\n    const { container } = render(\n      <Modal visible={false}>\n        <a data-testid={'inside'} href={'#hello'}>\n          Hello\n        </a>\n      </Modal>\n    );\n    expect(container.children.length).toBe(0);\n  });\n\n  test('invisible modals will not be the active modal', () => {\n    const { getByTestId } = render(\n      <>\n        <Modal key={'modal-a'} visible={true}>\n          <a data-testid={'inside-a'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n        <Modal key={'modal-b'} visible={false}>\n          <a data-testid={'inside-b'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n      </>\n    );\n    const insideElement = getByTestId('inside-a');\n    const dialogElements = document.body.querySelectorAll('[role=dialog]');\n    expect(dialogElements.length).toBe(1);\n    expect(dialogElements[0].contains(insideElement)).toBeTruthy();\n  });\n\n  test('multiple modals will only mark one as active', () => {\n    const { getByTestId } = render(\n      <>\n        <Modal key={'modal-a'} visible={true}>\n          <a data-testid={'inside-a'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n        <Modal key={'modal-b'} visible={true}>\n          <a data-testid={'inside-b'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n      </>\n    );\n    const insideElement = getByTestId('inside-b');\n    const dialogElements = document.body.querySelectorAll('[role=dialog]');\n    expect(dialogElements.length).toBe(1);\n    expect(dialogElements[0].contains(insideElement)).toBeTruthy();\n  });\n\n  test('modal active state changes propogate', () => {\n    const { rerender, getByTestId } = render(\n      <>\n        <Modal key={'modal-a'} visible={true}>\n          <a data-testid={'inside-a'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n        <Modal key={'modal-b'} visible={false}>\n          <a data-testid={'inside-b'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n      </>\n    );\n\n    rerender(\n      <>\n        <Modal key={'modal-a'} visible={true}>\n          <a data-testid={'inside-a'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n        <Modal key={'modal-b'} visible={true}>\n          <a data-testid={'inside-b'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n      </>\n    );\n\n    const insideElement = getByTestId('inside-b');\n    const dialogElements = document.body.querySelectorAll('[role=dialog]');\n    expect(dialogElements.length).toBe(1);\n    expect(dialogElements[0].contains(insideElement)).toBeTruthy();\n  });\n\n  test('removed modal sets others active state', () => {\n    const { rerender, getByTestId } = render(\n      <>\n        <Modal key={'modal-a'} visible={true}>\n          <a data-testid={'inside-a'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n        <Modal key={'modal-b'} visible={true}>\n          <a data-testid={'inside-b'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n      </>\n    );\n\n    rerender(\n      <Modal key={'modal-a'} visible={true}>\n        <a data-testid={'inside-a'} href={'#hello'}>\n          Hello\n        </a>\n      </Modal>\n    );\n\n    const insideElement = getByTestId('inside-a');\n    const dialogElements = document.body.querySelectorAll('[role=dialog]');\n    expect(dialogElements.length).toBe(1);\n    expect(dialogElements[0].contains(insideElement)).toBeTruthy();\n  });\n\n  test('executes onShow callback when initially showing', () => {\n    const onShowCallback = jest.fn();\n    render(<Modal onShow={onShowCallback} visible={true} />);\n    expect(onShowCallback).toBeCalledTimes(1);\n  });\n\n  test('does not execute onShow callback when initially hidden', () => {\n    const onShowCallback = jest.fn();\n    render(<Modal onShow={onShowCallback} visible={false} />);\n    expect(onShowCallback).toBeCalledTimes(0);\n  });\n\n  test('does not execute onDismiss callback when initially hidden', () => {\n    const onDismissCallback = jest.fn();\n    render(<Modal onDismiss={onDismissCallback} visible={false} />);\n    expect(onDismissCallback).toBeCalledTimes(0);\n  });\n\n  test('does not execute onDismiss callback when initially showing', () => {\n    const onDismissCallback = jest.fn();\n    render(<Modal onDismiss={onDismissCallback} visible={true} />);\n    expect(onDismissCallback).toBeCalledTimes(0);\n  });\n\n  test('executes onShow callback when visibility changes', () => {\n    const onShowCallback = jest.fn();\n    const { rerender } = render(\n      <Modal onShow={onShowCallback} visible={false} />\n    );\n    expect(onShowCallback).toBeCalledTimes(0);\n    rerender(<Modal onShow={onShowCallback} visible={true} />);\n    expect(onShowCallback).toBeCalledTimes(1);\n  });\n\n  test('executes onDismiss callback when visibility changes', () => {\n    const onDismissCallback = jest.fn();\n    const { rerender } = render(\n      <Modal onDismiss={onDismissCallback} visible={true} />\n    );\n    expect(onDismissCallback).toBeCalledTimes(0);\n    rerender(<Modal onDismiss={onDismissCallback} visible={false} />);\n    expect(onDismissCallback).toBeCalledTimes(1);\n  });\n\n  test('animationTypes none is the same as omitting', () => {\n    const { rerender, baseElement } = render(\n      <Modal animationType={'none'} visible={true} />\n    );\n    const animationNoneElement = baseElement.lastChild.lastChild;\n    const animationNoneStyle = window.getComputedStyle(\n      animationNoneElement,\n      null\n    );\n    rerender(<Modal visible={true} />);\n    const animationMissingElement = baseElement.lastChild.lastChild;\n    const animationMissingStyle = window.getComputedStyle(\n      animationMissingElement,\n      null\n    );\n    const styleProps = new Set();\n\n    for (let i = 0; i < animationNoneStyle.length; i++) {\n      styleProps.add(animationNoneStyle[i]);\n    }\n\n    for (let i = 0; i < animationMissingStyle.length; i++) {\n      styleProps.add(animationMissingStyle[i]);\n    }\n\n    for (const prop of styleProps) {\n      expect(animationNoneStyle[prop]).toEqual(animationMissingStyle[prop]);\n    }\n  });\n\n  test('creates view with role=\"dialog\" when active', () => {\n    const { baseElement } = render(\n      <Modal visible={true}>\n        <a href={'#hello'}>Hello</a>\n      </Modal>\n    );\n    const dialogElement =\n      baseElement.lastChild.querySelector('[role=\"dialog\"]');\n    expect(dialogElement).not.toBeNull();\n    expect(dialogElement.getAttribute('role')).toBe('dialog');\n    expect(dialogElement.getAttribute('aria-modal')).toBe('true');\n  });\n\n  test('focus is trapped by default', () => {\n    render(\n      <>\n        <a data-testid={'outside'} href={'#outside'}>\n          Outside\n        </a>\n        <Modal>\n          <a data-testid={'inside'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n      </>\n    );\n\n    const outsideElement = document.querySelector('[data-testid=\"outside\"]');\n    const insideElement = document.querySelector('[data-testid=\"inside\"]');\n    outsideElement.focus();\n    expect(document.activeElement).toBe(insideElement);\n  });\n\n  test('focus is trapped when active flag changes', () => {\n    const { rerender } = render(\n      <>\n        <a data-testid={'outside'} href={'#outside'}>\n          Outside\n        </a>\n        <Modal visible={false}>\n          <a data-testid={'inside'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n      </>\n    );\n\n    const outsideElement = document.querySelector('[data-testid=\"outside\"]');\n    outsideElement.focus();\n    expect(document.activeElement).toBe(outsideElement);\n\n    rerender(\n      <>\n        <a data-testid={'outside'} href={'#outside'}>\n          Outside\n        </a>\n        <Modal visible={true}>\n          <a data-testid={'inside'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n      </>\n    );\n\n    const insideElement = document.querySelector('[data-testid=\"inside\"]');\n    expect(document.activeElement).toBe(insideElement);\n  });\n\n  test('focus is not trapped after closing modal', () => {\n    const { rerender } = render(\n      <>\n        <a data-testid={'outside'} href={'#outside'}>\n          Outside\n        </a>\n        <Modal visible={true} />\n      </>\n    );\n\n    const outsideElement = document.querySelector('[data-testid=\"outside\"]');\n    const onDismissCallback = jest.fn(() => outsideElement.focus());\n\n    rerender(\n      <>\n        <a data-testid={'outside'} href={'#outside'}>\n          Outside\n        </a>\n        <Modal onDismiss={onDismissCallback} visible={false} />\n      </>\n    );\n\n    expect(onDismissCallback).toBeCalledTimes(1);\n    expect(document.activeElement).toBe(outsideElement);\n  });\n\n  test('focus is brought back to the element that triggered modal after closing', () => {\n    const { rerender } = render(\n      <>\n        <a data-testid={'outside'} href={'#outside'}>\n          Outside\n        </a>\n        <Modal visible={false}>\n          <a data-testid={'inside'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n        <a data-testid={'modal-trigger'} href={'#modal-trigger'}>\n          Outside\n        </a>\n      </>\n    );\n\n    const modalTrigger = document.querySelector(\n      '[data-testid=\"modal-trigger\"]'\n    );\n    modalTrigger.focus();\n    expect(document.activeElement).toBe(modalTrigger);\n\n    rerender(\n      <>\n        <a data-testid={'outside'} href={'#outside'}>\n          Outside\n        </a>\n        <Modal visible={true}>\n          <a data-testid={'inside'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n        <a data-testid={'modal-trigger'} href={'#modal-trigger'}>\n          Outside\n        </a>\n      </>\n    );\n\n    const insideElement = document.querySelector('[data-testid=\"inside\"]');\n    expect(document.activeElement).toBe(insideElement);\n\n    rerender(\n      <>\n        <a data-testid={'outside'} href={'#outside'}>\n          Outside\n        </a>\n        <Modal visible={false}>\n          <a data-testid={'inside'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n        <a data-testid={'modal-trigger'} href={'#modal-trigger'}>\n          Outside\n        </a>\n      </>\n    );\n\n    expect(document.activeElement).toBe(modalTrigger);\n  });\n\n  test('focus is brought back to the body when element that triggered modal is removed from the DOM after closing modal', () => {\n    const { rerender } = render(\n      <>\n        <a data-testid={'outside'} href={'#outside'}>\n          Outside\n        </a>\n        <Modal visible={false}>\n          <a data-testid={'inside'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n        <a data-testid={'modal-trigger'} href={'#modal-trigger'}>\n          Outside\n        </a>\n      </>\n    );\n\n    const modalTrigger = document.querySelector(\n      '[data-testid=\"modal-trigger\"]'\n    );\n    modalTrigger.focus();\n    expect(document.activeElement).toBe(modalTrigger);\n\n    rerender(\n      <>\n        <a data-testid={'outside'} href={'#outside'}>\n          Outside\n        </a>\n        <Modal visible={true}>\n          <a data-testid={'inside'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n        <a data-testid={'modal-trigger'} href={'#modal-trigger'}>\n          Outside\n        </a>\n      </>\n    );\n\n    const insideElement = document.querySelector('[data-testid=\"inside\"]');\n    expect(document.activeElement).toBe(insideElement);\n\n    rerender(\n      <>\n        <a data-testid={'outside'} href={'#outside'}>\n          Outside\n        </a>\n        <Modal visible={false}>\n          <a data-testid={'inside'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n      </>\n    );\n\n    expect(document.activeElement).toBe(document.body);\n  });\n\n  test('focus is trapped when active', () => {\n    render(\n      <>\n        <a data-testid={'outside'} href={'#outside'}>\n          Outside\n        </a>\n        <Modal visible={true}>\n          <a data-testid={'inside'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n      </>\n    );\n\n    const outsideElement = document.querySelector('[data-testid=\"outside\"]');\n    const insideElement = document.querySelector('[data-testid=\"inside\"]');\n    outsideElement.focus();\n    expect(document.activeElement).toBe(insideElement);\n  });\n\n  test('focus wraps forwards', () => {\n    render(\n      <>\n        <Modal visible={true}>\n          <a data-testid={'inside-a'} href={'#'}>\n            Inside A\n          </a>\n          <a data-testid={'inside-b'} href={'#'}>\n            Inside B\n          </a>\n          <a data-testid={'inside-c'} href={'#'}>\n            Inside C\n          </a>\n        </Modal>\n      </>\n    );\n\n    const insideStartElement = document.querySelector(\n      '[data-testid=\"inside-a\"]'\n    );\n    const insideEndElement = document.querySelector('[data-testid=\"inside-c\"]');\n    // This is ugly - perhaps there's a better way?\n    const focusBracket =\n      insideEndElement.parentNode.parentNode.parentNode.nextSibling;\n    insideEndElement.focus();\n    focusBracket.focus();\n    expect(document.activeElement).toBe(insideStartElement);\n  });\n\n  test('focus wraps backwards', () => {\n    render(\n      <>\n        <Modal visible={true}>\n          <a data-testid={'inside-a'} href={'#'}>\n            Inside A\n          </a>\n          <a data-testid={'inside-b'} href={'#'}>\n            Inside B\n          </a>\n          <a data-testid={'inside-c'} href={'#'}>\n            Inside C\n          </a>\n        </Modal>\n      </>\n    );\n\n    const insideStartElement = document.querySelector(\n      '[data-testid=\"inside-a\"]'\n    );\n    const insideEndElement = document.querySelector('[data-testid=\"inside-c\"]');\n    // This is ugly - perhaps there's a better way?\n    const focusBracket =\n      insideEndElement.parentNode.parentNode.parentNode.previousSibling;\n    insideStartElement.focus();\n    focusBracket.focus();\n    expect(document.activeElement).toBe(insideEndElement);\n  });\n\n  test('focus is trapped without contents', () => {\n    render(\n      <>\n        <a data-testid={'outside'} href={'#outside'}>\n          Outside\n        </a>\n        <Modal visible={true}>\n          <div>There are no focusable contents.</div>\n        </Modal>\n      </>\n    );\n    const outsideElement = document.querySelector('[data-testid=\"outside\"]');\n    outsideElement.focus();\n    expect(document.activeElement).not.toBe(outsideElement);\n    expect(document.activeElement).not.toBe(document.body);\n  });\n\n  test('focus is not trapped when inactive', () => {\n    render(\n      <>\n        <a data-testid={'outside'} href={'#outside'}>\n          Outside\n        </a>\n        <Modal visible={false}>\n          <a data-testid={'inside'} href={'#hello'}>\n            Hello\n          </a>\n        </Modal>\n      </>\n    );\n    const outsideElement = document.querySelector('[data-testid=\"outside\"]');\n    outsideElement.focus();\n    expect(document.activeElement).toBe(outsideElement);\n  });\n\n  test('creates portal outside of the react container', () => {\n    const { container, baseElement } = render(\n      <Modal visible={true}>\n        <a data-testid={'hello'} href={'#hello'}>\n          Hello World\n        </a>\n      </Modal>\n    );\n    const helloAnchor = document.querySelector('[data-testid=\"hello\"]');\n    expect(container.children.length).toBe(0);\n    expect(helloAnchor).not.toBeNull();\n    expect(baseElement.firstChild).toBe(container);\n    expect(baseElement.lastChild.firstChild.contains(helloAnchor)).toBeTruthy();\n  });\n\n  test('portal created is a div', () => {\n    const { baseElement } = render(\n      <Modal visible={true}>\n        <a data-testid={'hello'} href={'#hello'}>\n          Hello World\n        </a>\n      </Modal>\n    );\n    expect(baseElement.lastChild.tagName).toBe('DIV');\n  });\n\n  test('ref must be set before `mount` hook', () => {\n    const spy = jest.fn();\n\n    function TestComponent() {\n      React.useEffect(() => spy('mount'), []);\n      return (\n        <Modal visible={true}>\n          <a ref={(ref) => (ref ? spy('ref') : spy('noref'))} />\n        </Modal>\n      );\n    }\n\n    render(<TestComponent />);\n\n    expect(spy).toHaveBeenNthCalledWith(1, 'ref');\n    expect(spy).toHaveBeenNthCalledWith(2, 'mount');\n  });\n\n  test('escape key fires onRequestClose', () => {\n    const spy = jest.fn();\n\n    render(<Modal onRequestClose={spy} visible={true} />);\n\n    fireEvent.keyUp(document, { key: 'Escape' });\n\n    expect(spy).toHaveBeenCalledTimes(1);\n  });\n\n  test('escape key fires onRequestClose for top modal only', () => {\n    const spyA = jest.fn();\n    const spyB = jest.fn();\n\n    render(\n      <>\n        <Modal onRequestClose={spyA} visible={true} />\n        <Modal onRequestClose={spyB} visible={true} />\n      </>\n    );\n\n    fireEvent.keyUp(document, { key: 'Escape' });\n\n    expect(spyA).toHaveBeenCalledTimes(0);\n    expect(spyB).toHaveBeenCalledTimes(1);\n  });\n\n  test('escape key fires onRequestClose for top modal only with animation', () => {\n    const spyA = jest.fn();\n    const spyB = jest.fn();\n\n    const { getByTestId, rerender } = render(\n      <>\n        <Modal animationType={'slide'} onRequestClose={spyA} visible={false}>\n          <a data-testid={'a'} />\n\n          <Modal animationType={'slide'} onRequestClose={spyB} visible={false}>\n            <a data-testid={'b'} />\n          </Modal>\n        </Modal>\n      </>\n    );\n\n    rerender(\n      <>\n        <Modal animationType={'slide'} onRequestClose={spyA} visible={true}>\n          <a data-testid={'a'} />\n\n          <Modal animationType={'slide'} onRequestClose={spyB} visible={true}>\n            <a data-testid={'b'} />\n          </Modal>\n        </Modal>\n      </>\n    );\n\n    // This is kind of ugly but I can't find a better way to target just the animation div\n    const animationAElement =\n      getByTestId('a').parentElement.parentElement.parentElement.parentElement;\n    const animationBElement =\n      getByTestId('b').parentElement.parentElement.parentElement.parentElement;\n\n    fireEvent.animationEnd(animationAElement);\n    fireEvent.animationEnd(animationBElement);\n\n    fireEvent.keyUp(document, { key: 'Escape' });\n\n    expect(spyA).toHaveBeenCalledTimes(0);\n    expect(spyB).toHaveBeenCalledTimes(1);\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Modal/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use client';\n\nimport type { ViewProps } from '../View';\n\nimport * as React from 'react';\nimport ModalPortal from './ModalPortal';\nimport ModalAnimation from './ModalAnimation';\nimport ModalContent from './ModalContent';\nimport ModalFocusTrap from './ModalFocusTrap';\n\nexport type ModalProps = {\n  ...ViewProps,\n  animationType?: 'none' | 'slide' | 'fade',\n  children: any,\n  hardwareAccelerated?: ?boolean,\n  onDismiss?: ?() => mixed,\n  onOrientationChange?: ?(e: {|\n    orientation: 'portrait' | 'landscape'\n  |}) => void,\n  onRequestClose?: ?() => void,\n  onShow?: ?() => void,\n  presentationStyle?: ?(\n    | 'fullScreen'\n    | 'pageSheet'\n    | 'formSheet'\n    | 'overFullScreen'\n  ),\n  statusBarTranslucent?: ?boolean,\n  supportedOrientations?: ?Array<\n    | 'portrait'\n    | 'portrait-upside-down'\n    | 'landscape'\n    | 'landscape-left'\n    | 'landscape-right'\n  >,\n  transparent?: ?boolean,\n  visible?: ?boolean\n};\n\nlet uniqueModalIdentifier = 0;\n\nconst activeModalStack = [];\nconst activeModalListeners = {};\n\nfunction notifyActiveModalListeners() {\n  if (activeModalStack.length === 0) {\n    return;\n  }\n  const activeModalId = activeModalStack[activeModalStack.length - 1];\n  activeModalStack.forEach((modalId) => {\n    if (modalId in activeModalListeners) {\n      activeModalListeners[modalId](modalId === activeModalId);\n    }\n  });\n}\n\nfunction removeActiveModal(modalId) {\n  if (modalId in activeModalListeners) {\n    // Before removing this listener we should probably tell it\n    // that it's no longer the active modal for sure.\n    activeModalListeners[modalId](false);\n    delete activeModalListeners[modalId];\n  }\n  const index = activeModalStack.indexOf(modalId);\n  if (index !== -1) {\n    activeModalStack.splice(index, 1);\n    notifyActiveModalListeners();\n  }\n}\n\nfunction addActiveModal(modalId, listener) {\n  removeActiveModal(modalId);\n  activeModalStack.push(modalId);\n  activeModalListeners[modalId] = listener;\n  notifyActiveModalListeners();\n}\n\nconst Modal: React.AbstractComponent<\n  ModalProps,\n  React.ElementRef<typeof ModalContent>\n> = React.forwardRef((props, forwardedRef) => {\n  const {\n    animationType,\n    children,\n    onDismiss,\n    onRequestClose,\n    onShow,\n    transparent,\n    visible = true,\n    ...rest\n  } = props;\n\n  // Set a unique model identifier so we can correctly route\n  // dismissals and check the layering of modals.\n  const modalId = React.useMemo(() => uniqueModalIdentifier++, []);\n\n  const [isActive, setIsActive] = React.useState(false);\n\n  const onDismissCallback = React.useCallback(() => {\n    removeActiveModal(modalId);\n    if (onDismiss) {\n      onDismiss();\n    }\n  }, [modalId, onDismiss]);\n\n  const onShowCallback = React.useCallback(() => {\n    addActiveModal(modalId, setIsActive);\n    if (onShow) {\n      onShow();\n    }\n  }, [modalId, onShow]);\n\n  React.useEffect(() => {\n    return () => removeActiveModal(modalId);\n  }, [modalId]);\n\n  return (\n    <ModalPortal>\n      <ModalAnimation\n        animationType={animationType}\n        onDismiss={onDismissCallback}\n        onShow={onShowCallback}\n        visible={visible}\n      >\n        <ModalFocusTrap active={isActive}>\n          <ModalContent\n            {...rest}\n            active={isActive}\n            onRequestClose={onRequestClose}\n            ref={forwardedRef}\n            transparent={transparent}\n          >\n            {children}\n          </ModalContent>\n        </ModalFocusTrap>\n      </ModalAnimation>\n    </ModalPortal>\n  );\n});\n\nexport default Modal;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/NativeEventEmitter/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport NativeEventEmitter from '../../vendor/react-native/EventEmitter/NativeEventEmitter';\nexport default NativeEventEmitter;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/NativeModules/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @noflow\n */\n\nimport UIManager from '../UIManager';\n\n// NativeModules shim\nconst NativeModules = {\n  UIManager\n};\n\nexport default NativeModules;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/PanResponder/Alternative.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n/**\n * PAN RESPONDER\n *\n * `PanResponder` uses the Responder System to reconcile several touches into\n * a single gesture. It makes single-touch gestures resilient to extra touches,\n * and can be used to recognize simple multi-touch gestures. For each handler,\n * it provides a `gestureState` object alongside the ResponderEvent object.\n *\n * By default, `PanResponder` holds an `InteractionManager` handle to block\n * long-running JS events from interrupting active gestures.\n *\n * A graphical explanation of the touch data flow:\n *\n * +----------------------------+             +--------------------------------+\n * | ResponderTouchHistoryStore |             |TouchHistoryMath                |\n * +----------------------------+             +----------+---------------------+\n * |Global store of touchHistory|             |Allocation-less math util       |\n * |including activeness, start |             |on touch history (centroids     |\n * |position, prev/cur position.|             |and multitouch movement etc)    |\n * |                            |             |                                |\n * +----^-----------------------+             +----^---------------------------+\n *      |                                          |\n *      | (records relevant history                |\n *      |  of touches relevant for                 |\n *      |  implementing higher level               |\n *      |  gestures)                               |\n *      |                                          |\n * +----+-----------------------+             +----|---------------------------+\n * | ResponderEventPlugin       |             |    |   Your App/Component      |\n * +----------------------------+             +----|---------------------------+\n * |Negotiates which view gets  | Low level   |    |             High level    |\n * |onResponderMove events.     | events w/   |  +-+-------+     events w/     |\n * |Also records history into   | touchHistory|  |   Pan   |     multitouch +  |\n * |ResponderTouchHistoryStore. +---------------->Responder+-----> accumulative|\n * +----------------------------+ attached to |  |         |     distance and  |\n *                                 each event |  +---------+     velocity.     |\n *                                            |                                |\n *                                            |                                |\n *                                            +--------------------------------+\n */\n\n'use strict';\n\nimport type { PressEvent } from '../../vendor/react-native/Types/CoreEventTypes';\n\nimport InteractionManager from '../InteractionManager';\nimport TouchHistoryMath from '../../vendor/react-native/TouchHistoryMath';\n\nexport type GestureState = {|\n  // ID of the gestureState; persisted as long as there's a pointer on screen\n  stateID: number,\n  // The latest screen coordinates of the gesture\n  x: number,\n  // The latest screen coordinates of the gesture\n  y: number,\n  // The screen coordinates of the responder grant\n  initialX: number,\n  // The screen coordinates of the responder grant\n  initialY: number,\n  // Accumulated distance of the gesture since it started\n  deltaX: number,\n  // Accumulated distance of the gesture since it started\n  deltaY: number,\n  // Current velocity of the gesture\n  velocityX: number,\n  // Current velocity of the gesture\n  velocityY: number,\n  // Number of touches currently on screen\n  numberActiveTouches: number,\n  _accountsForMovesUpTo: number\n|};\n\ntype ActiveCallback = (\n  event: PressEvent,\n  gestureState: GestureState\n) => boolean;\ntype PassiveCallback = (event: PressEvent, gestureState: GestureState) => void;\n\ntype PanResponderConfig = $ReadOnly<{|\n  // Negotiate for the responder\n  onMoveShouldSetResponder?: ?ActiveCallback,\n  onMoveShouldSetResponderCapture?: ?ActiveCallback,\n  onStartShouldSetResponder?: ?ActiveCallback,\n  onStartShouldSetResponderCapture?: ?ActiveCallback,\n  onPanTerminationRequest?: ?ActiveCallback,\n  // Gesture started\n  onPanGrant?: ?PassiveCallback,\n  // Gesture rejected\n  onPanReject?: ?PassiveCallback,\n  // A pointer touched the screen\n  onPanStart?: ?PassiveCallback,\n  // A pointer moved\n  onPanMove?: ?PassiveCallback,\n  // A pointer was removed from the screen\n  onPanEnd?: ?PassiveCallback,\n  // All pointers removed, gesture successful\n  onPanRelease?: ?PassiveCallback,\n  // Gesture cancelled\n  onPanTerminate?: ?PassiveCallback\n|}>;\n\nconst {\n  currentCentroidX,\n  currentCentroidY,\n  currentCentroidXOfTouchesChangedAfter,\n  currentCentroidYOfTouchesChangedAfter,\n  previousCentroidXOfTouchesChangedAfter,\n  previousCentroidYOfTouchesChangedAfter\n} = TouchHistoryMath;\n\nconst PanResponder = {\n  _initializeGestureState(gestureState: GestureState) {\n    gestureState.x = 0;\n    gestureState.y = 0;\n    gestureState.initialX = 0;\n    gestureState.initialY = 0;\n    gestureState.deltaX = 0;\n    gestureState.deltaY = 0;\n    gestureState.velocityX = 0;\n    gestureState.velocityY = 0;\n    gestureState.numberActiveTouches = 0;\n    // All `gestureState` accounts for timeStamps up until:\n    gestureState._accountsForMovesUpTo = 0;\n  },\n\n  /**\n   * Take all recently moved touches, calculate how the centroid has changed just for those\n   * recently moved touches, and append that change to an accumulator. This is\n   * to (at least) handle the case where the user is moving three fingers, and\n   * then one of the fingers stops but the other two continue.\n   *\n   * This is very different than taking all of the recently moved touches and\n   * storing their centroid as `dx/dy`. For correctness, we must *accumulate\n   * changes* in the centroid of recently moved touches.\n   *\n   * There is also some nuance with how we handle multiple moved touches in a\n   * single event. Multiple touches generate two 'move' events, each of\n   * them triggering `onResponderMove`. But with the way `PanResponder` works,\n   * all of the gesture inference is performed on the first dispatch, since it\n   * looks at all of the touches. Therefore, `PanResponder` does not call\n   * `onResponderMove` passed the first dispatch. This diverges from the\n   * typical responder callback pattern (without using `PanResponder`), but\n   * avoids more dispatches than necessary.\n   *\n   * When moving two touches in opposite directions, the cumulative\n   * distance is zero in each dimension. When two touches move in parallel five\n   * pixels in the same direction, the cumulative distance is five, not ten. If\n   * two touches start, one moves five in a direction, then stops and the other\n   * touch moves fives in the same direction, the cumulative distance is ten.\n   *\n   * This logic requires a kind of processing of time \"clusters\" of touch events\n   * so that two touch moves that essentially occur in parallel but move every\n   * other frame respectively, are considered part of the same movement.\n   *\n   * x/y: If a move event has been observed, `(x, y)` is the centroid of the most\n   * recently moved \"cluster\" of active touches.\n   * deltaX/deltaY: Cumulative touch distance. Accounts for touch moves that are\n   * clustered together in time, moving the same direction. Only valid when\n   * currently responder (otherwise, it only represents the drag distance below\n   * the threshold).\n   */\n  _updateGestureStateOnMove(\n    gestureState: GestureState,\n    touchHistory: $PropertyType<PressEvent, 'touchHistory'>\n  ) {\n    const movedAfter = gestureState._accountsForMovesUpTo;\n    const prevX = previousCentroidXOfTouchesChangedAfter(\n      touchHistory,\n      movedAfter\n    );\n    const prevY = previousCentroidYOfTouchesChangedAfter(\n      touchHistory,\n      movedAfter\n    );\n    const prevDeltaX = gestureState.deltaX;\n    const prevDeltaY = gestureState.deltaY;\n\n    const x = currentCentroidXOfTouchesChangedAfter(touchHistory, movedAfter);\n    const y = currentCentroidYOfTouchesChangedAfter(touchHistory, movedAfter);\n    const deltaX = prevDeltaX + (x - prevX);\n    const deltaY = prevDeltaY + (y - prevY);\n    // TODO: This must be filtered intelligently.\n    const dt =\n      touchHistory.mostRecentTimeStamp - gestureState._accountsForMovesUpTo;\n\n    gestureState.deltaX = deltaX;\n    gestureState.deltaY = deltaY;\n    gestureState.numberActiveTouches = touchHistory.numberActiveTouches;\n    gestureState.velocityX = (deltaX - prevDeltaX) / dt;\n    gestureState.velocityY = (deltaY - prevDeltaY) / dt;\n    gestureState.x = x;\n    gestureState.y = y;\n    gestureState._accountsForMovesUpTo = touchHistory.mostRecentTimeStamp;\n  },\n\n  /**\n   * Enhanced versions of all of the responder callbacks that provide not only\n   * the `ResponderEvent`, but also the `PanResponder` gesture state.\n   *\n   * In general, for events that have capture equivalents, we update the\n   * gestureState once in the capture phase and can use it in the bubble phase\n   * as well.\n   */\n  create(config: PanResponderConfig): {|\n    getInteractionHandle: () => ?number,\n    panHandlers: {|\n      onMoveShouldSetResponder: (event: PressEvent) => boolean,\n      onMoveShouldSetResponderCapture: (event: PressEvent) => boolean,\n      onResponderEnd: (event: PressEvent) => void,\n      onResponderGrant: (event: PressEvent) => void,\n      onResponderMove: (event: PressEvent) => void,\n      onResponderReject: (event: PressEvent) => void,\n      onResponderRelease: (event: PressEvent) => void,\n      onResponderStart: (event: PressEvent) => void,\n      onResponderTerminate: (event: PressEvent) => void,\n      onResponderTerminationRequest: (event: PressEvent) => boolean,\n      onStartShouldSetResponder: (event: PressEvent) => boolean,\n      onStartShouldSetResponderCapture: (event: PressEvent) => boolean\n    |}\n  |} {\n    const interactionState = {\n      handle: (null: ?number)\n    };\n    const gestureState: GestureState = {\n      // Useful for debugging\n      stateID: Math.random(),\n      x: 0,\n      y: 0,\n      initialX: 0,\n      initialY: 0,\n      deltaX: 0,\n      deltaY: 0,\n      velocityX: 0,\n      velocityY: 0,\n      numberActiveTouches: 0,\n      _accountsForMovesUpTo: 0\n    };\n\n    const {\n      onStartShouldSetResponder,\n      onStartShouldSetResponderCapture,\n      onMoveShouldSetResponder,\n      onMoveShouldSetResponderCapture,\n      onPanGrant,\n      onPanStart,\n      onPanMove,\n      onPanEnd,\n      onPanRelease,\n      onPanReject,\n      onPanTerminate,\n      onPanTerminationRequest\n    } = config;\n\n    const panHandlers = {\n      onStartShouldSetResponder(event: PressEvent): boolean {\n        return onStartShouldSetResponder != null\n          ? onStartShouldSetResponder(event, gestureState)\n          : false;\n      },\n      onMoveShouldSetResponder(event: PressEvent): boolean {\n        return onMoveShouldSetResponder != null\n          ? onMoveShouldSetResponder(event, gestureState)\n          : false;\n      },\n      onStartShouldSetResponderCapture(event: PressEvent): boolean {\n        // TODO: Actually, we should reinitialize the state any time\n        // touches.length increases from 0 active to > 0 active.\n        if (event.nativeEvent.touches.length === 1) {\n          PanResponder._initializeGestureState(gestureState);\n        }\n        gestureState.numberActiveTouches =\n          event.touchHistory.numberActiveTouches;\n        return onStartShouldSetResponderCapture != null\n          ? onStartShouldSetResponderCapture(event, gestureState)\n          : false;\n      },\n\n      onMoveShouldSetResponderCapture(event: PressEvent): boolean {\n        const touchHistory = event.touchHistory;\n        // Responder system incorrectly dispatches should* to current responder\n        // Filter out any touch moves past the first one - we would have\n        // already processed multi-touch geometry during the first event.\n        // NOTE: commented out because new responder system should get it right.\n        //if (gestureState._accountsForMovesUpTo === touchHistory.mostRecentTimeStamp) {\n        //  return false;\n        //}\n        PanResponder._updateGestureStateOnMove(gestureState, touchHistory);\n        return onMoveShouldSetResponderCapture != null\n          ? onMoveShouldSetResponderCapture(event, gestureState)\n          : false;\n      },\n\n      onResponderGrant(event: PressEvent): void {\n        if (!interactionState.handle) {\n          interactionState.handle =\n            InteractionManager.createInteractionHandle();\n        }\n        gestureState.initialX = currentCentroidX(event.touchHistory);\n        gestureState.initialY = currentCentroidY(event.touchHistory);\n        gestureState.deltaX = 0;\n        gestureState.deltaY = 0;\n        if (onPanGrant != null) {\n          onPanGrant(event, gestureState);\n        }\n      },\n\n      onResponderReject(event: PressEvent): void {\n        clearInteractionHandle(\n          interactionState,\n          onPanReject,\n          event,\n          gestureState\n        );\n      },\n\n      onResponderStart(event: PressEvent): void {\n        const { numberActiveTouches } = event.touchHistory;\n        gestureState.numberActiveTouches = numberActiveTouches;\n        if (onPanStart != null) {\n          onPanStart(event, gestureState);\n        }\n      },\n\n      onResponderMove(event: PressEvent): void {\n        const touchHistory = event.touchHistory;\n        // Guard against the dispatch of two touch moves when there are two\n        // simultaneously changed touches.\n        if (\n          gestureState._accountsForMovesUpTo ===\n          touchHistory.mostRecentTimeStamp\n        ) {\n          return;\n        }\n        // Filter out any touch moves past the first one - we would have\n        // already processed multi-touch geometry during the first event.\n        PanResponder._updateGestureStateOnMove(gestureState, touchHistory);\n        if (onPanMove != null) {\n          onPanMove(event, gestureState);\n        }\n      },\n\n      onResponderEnd(event: PressEvent): void {\n        const { numberActiveTouches } = event.touchHistory;\n        gestureState.numberActiveTouches = numberActiveTouches;\n        clearInteractionHandle(interactionState, onPanEnd, event, gestureState);\n      },\n\n      onResponderRelease(event: PressEvent): void {\n        clearInteractionHandle(\n          interactionState,\n          onPanRelease,\n          event,\n          gestureState\n        );\n        PanResponder._initializeGestureState(gestureState);\n      },\n\n      onResponderTerminate(event: PressEvent): void {\n        clearInteractionHandle(\n          interactionState,\n          onPanTerminate,\n          event,\n          gestureState\n        );\n        PanResponder._initializeGestureState(gestureState);\n      },\n\n      onResponderTerminationRequest(event: PressEvent): boolean {\n        return onPanTerminationRequest != null\n          ? onPanTerminationRequest(event, gestureState)\n          : true;\n      }\n    };\n    return {\n      panHandlers,\n      getInteractionHandle(): ?number {\n        return interactionState.handle;\n      }\n    };\n  }\n};\n\nfunction clearInteractionHandle(\n  interactionState: { handle: ?number },\n  callback: ?(ActiveCallback | PassiveCallback),\n  event: PressEvent,\n  gestureState: GestureState\n) {\n  if (interactionState.handle) {\n    InteractionManager.clearInteractionHandle(interactionState.handle);\n    interactionState.handle = null;\n  }\n  if (callback) {\n    callback(event, gestureState);\n  }\n}\n\nexport default PanResponder;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/PanResponder/index.js",
    "content": "// @flow strict\n\nimport PanResponder from '../../vendor/react-native/PanResponder';\nexport default PanResponder;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Picker/PickerItem.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @noflow\n */\n\nimport type { ColorValue } from '../../types';\n\nimport createElement from '../createElement';\n\ntype Props = {\n  color?: ColorValue,\n  label: string,\n  testID?: string,\n  value?: number | string\n};\n\nexport default function PickerItem(props: Props) {\n  const { color, label, testID, value } = props;\n  const style = { color };\n  return createElement('option', { children: label, style, testID, value });\n}\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Picker/__tests__/__snapshots__/index-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`components/Picker prop \"children\" items 1`] = `\n<option\n  value=\"value-1\"\n>\n  label-1\n</option>\n`;\n\nexports[`components/Picker prop \"children\" renders items 1`] = `\n<option\n  value=\"value-1\"\n>\n  label-1\n</option>\n`;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Picker/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport React from 'react';\nimport { render } from '@testing-library/react';\nimport Picker from '..';\n\nfunction findSelect(container) {\n  return container.querySelector('select');\n}\n\ndescribe('components/Picker', () => {\n  describe('prop \"children\"', () => {\n    test('renders items', () => {\n      const picker = (\n        <Picker>\n          <Picker.Item label=\"label-1\" value=\"value-1\" />\n          <Picker.Item label=\"label-2\" value=\"value-2\" />\n        </Picker>\n      );\n      const { container } = render(picker);\n      expect(container.firstChild.firstChild).toMatchSnapshot();\n    });\n\n    test('items', () => {\n      const pickerItem = <Picker.Item label=\"label-1\" value=\"value-1\" />;\n      const { container } = render(pickerItem);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"enabled\"', () => {\n    test('picker is disabled if false', () => {\n      const picker = (\n        <Picker enabled={false}>\n          <Picker.Item label=\"label-1\" value=\"value-1\" />\n          <Picker.Item label=\"label-2\" value=\"value-2\" />\n        </Picker>\n      );\n      const { container } = render(picker);\n      expect(findSelect(container).disabled).toBe(true);\n    });\n  });\n\n  describe('prop \"onValueChange\"', () => {\n    test('is called with (value, index)', () => {\n      const onValueChange = jest.fn();\n      const picker = (\n        <Picker onValueChange={onValueChange} selectedValue=\"value-1\">\n          <Picker.Item label=\"label-1\" value=\"value-1\" />\n          <Picker.Item label=\"label-2\" value=\"value-2\" />\n        </Picker>\n      );\n      const { container } = render(picker);\n      const select = findSelect(container);\n      // mock change event\n      select.selectedIndex = '1';\n      select.value = 'value-2';\n      select.dispatchEvent(new window.Event('change', { bubbles: true }));\n\n      expect(onValueChange).toHaveBeenCalledWith('value-2', 1);\n    });\n  });\n\n  describe('prop \"selectedValue\"', () => {\n    test('selects the correct item (string)', () => {\n      const picker = (\n        <Picker selectedValue=\"value-2\">\n          <Picker.Item label=\"label-1\" value=\"value-1\" />\n          <Picker.Item label=\"label-2\" value=\"value-2\" />\n        </Picker>\n      );\n      const { container } = render(picker);\n      expect(findSelect(container).value).toBe('value-2');\n    });\n\n    test('selects the correct item (number)', () => {\n      const picker = (\n        <Picker selectedValue={22}>\n          <Picker.Item label=\"label-1\" value={11} />\n          <Picker.Item label=\"label-2\" value={22} />\n        </Picker>\n      );\n      const { container } = render(picker);\n      expect(findSelect(container).value).toBe('22');\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Picker/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use client';\n\nimport type { PlatformMethods } from '../../types';\nimport type { ViewProps } from '../View';\n\nimport * as React from 'react';\nimport createElement from '../createElement';\nimport useMergeRefs from '../../modules/useMergeRefs';\nimport usePlatformMethods from '../../modules/usePlatformMethods';\nimport PickerItem from './PickerItem';\nimport StyleSheet from '../StyleSheet';\n\ntype PickerProps = {\n  ...ViewProps,\n  children?: typeof PickerItem | Array<typeof PickerItem>,\n  enabled?: boolean,\n  onValueChange?: (number | string, number) => void,\n  selectedValue?: number | string,\n  style?: any,\n  /* compat */\n  itemStyle?: any,\n  mode?: string,\n  prompt?: string\n};\n\nconst Picker: React.AbstractComponent<\n  PickerProps,\n  HTMLElement & PlatformMethods\n> = React.forwardRef((props, forwardedRef) => {\n  const {\n    children,\n    enabled,\n    onValueChange,\n    selectedValue,\n    style,\n    testID,\n    /* eslint-disable */\n    itemStyle,\n    mode,\n    prompt,\n    /* eslint-enable */\n    ...other\n  } = props;\n\n  const hostRef = React.useRef(null);\n\n  function handleChange(e: Object) {\n    const { selectedIndex, value } = e.target;\n    if (onValueChange) {\n      onValueChange(value, selectedIndex);\n    }\n  }\n\n  // $FlowFixMe\n  const supportedProps: any = {\n    children,\n    disabled: enabled === false ? true : undefined,\n    onChange: handleChange,\n    style: [styles.initial, style],\n    testID,\n    value: selectedValue,\n    ...other\n  };\n\n  const platformMethodsRef = usePlatformMethods(supportedProps);\n\n  const setRef = useMergeRefs(hostRef, platformMethodsRef, forwardedRef);\n\n  supportedProps.ref = setRef;\n\n  return createElement('select', supportedProps);\n});\n\n// $FlowFixMe\nPicker.Item = PickerItem;\n\nconst styles = StyleSheet.create({\n  initial: {\n    fontFamily: 'System',\n    fontSize: 'inherit',\n    margin: 0\n  }\n});\n\nexport default Picker;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/PixelRatio/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport Dimensions from '../Dimensions';\n\n/**\n * PixelRatio gives access to the device pixel density.\n */\nexport default class PixelRatio {\n  /**\n   * Returns the device pixel density.\n   */\n  static get(): number {\n    return Dimensions.get('window').scale;\n  }\n\n  /**\n   * No equivalent for Web\n   */\n  static getFontScale(): number {\n    return Dimensions.get('window').fontScale || PixelRatio.get();\n  }\n\n  /**\n   * Converts a layout size (dp) to pixel size (px).\n   * Guaranteed to return an integer number.\n   */\n  static getPixelSizeForLayoutSize(layoutSize: number): number {\n    return Math.round(layoutSize * PixelRatio.get());\n  }\n\n  /**\n   * Rounds a layout size (dp) to the nearest layout size that corresponds to\n   * an integer number of pixels. For example, on a device with a PixelRatio\n   * of 3, `PixelRatio.roundToNearestPixel(8.4) = 8.33`, which corresponds to\n   * exactly (8.33 * 3) = 25 pixels.\n   */\n  static roundToNearestPixel(layoutSize: number): number {\n    const ratio = PixelRatio.get();\n    return Math.round(layoutSize * ratio) / ratio;\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Platform/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport Platform from '../';\n\ndescribe('apis/Platform', () => {\n  describe('select', () => {\n    test('supports \"default\"', () => {\n      expect(Platform.select({ default: 'default' })).toEqual('default');\n    });\n\n    test('chooses \"web\"', () => {\n      expect(\n        Platform.select({\n          android: 'android',\n          ios: 'ios',\n          web: 'web',\n          default: 'default'\n        })\n      ).toEqual('web');\n    });\n  });\n\n  describe('isTesting', () => {\n    const NODE_ENV_BACKUP = process.env.NODE_ENV;\n\n    afterEach(() => {\n      process.env.NODE_ENV = NODE_ENV_BACKUP;\n    });\n\n    test('true when NODE_ENV is \"test\"', () => {\n      process.env.NODE_ENV = 'test';\n      expect(Platform.isTesting).toEqual(true);\n    });\n\n    test('false when NODE_ENV is not \"test\"', () => {\n      process.env.NODE_ENV = 'development';\n      expect(Platform.isTesting).toEqual(false);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Platform/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nconst Platform = {\n  OS: 'web',\n  select: (obj: Object): any => ('web' in obj ? obj.web : obj.default),\n  get isTesting(): boolean {\n    if (process.env.NODE_ENV === 'test') {\n      return true;\n    }\n    return false;\n  },\n  get Version(): string {\n    return '0.0.0';\n  }\n};\n\nexport default Platform;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Pressable/__tests__/__snapshots__/index-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`components/Pressable default 1`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  tabindex=\"0\"\n/>\n`;\n\nexports[`components/Pressable focus interaction 1`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  tabindex=\"0\"\n/>\n`;\n\nexports[`components/Pressable focus interaction 2`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  style=\"outline: focus-ring;\"\n  tabindex=\"0\"\n>\n  <div\n    data-testid=\"focus-content\"\n  />\n</div>\n`;\n\nexports[`components/Pressable focus interaction 3`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  style=\"\"\n  tabindex=\"0\"\n/>\n`;\n\nexports[`components/Pressable hover interaction 1`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  tabindex=\"0\"\n/>\n`;\n\nexports[`components/Pressable hover interaction 2`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  style=\"outline: hover-ring;\"\n  tabindex=\"0\"\n>\n  <div\n    data-testid=\"hover-content\"\n  />\n</div>\n`;\n\nexports[`components/Pressable hover interaction 3`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  style=\"\"\n  tabindex=\"0\"\n/>\n`;\n\nexports[`components/Pressable press interaction (keyboard) trigger press when keyup is on the same element 1`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  tabindex=\"0\"\n/>\n`;\n\nexports[`components/Pressable press interaction (keyboard) trigger press when keyup is on the same element 2`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  style=\"outline: press-ring;\"\n  tabindex=\"0\"\n>\n  <div\n    data-testid=\"press-content\"\n  />\n</div>\n`;\n\nexports[`components/Pressable press interaction (keyboard) trigger press when keyup is on the same element 3`] = `null`;\n\nexports[`components/Pressable press interaction (pointer) 1`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  tabindex=\"0\"\n/>\n`;\n\nexports[`components/Pressable press interaction (pointer) 2`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  style=\"outline: press-ring;\"\n  tabindex=\"0\"\n>\n  <div\n    data-testid=\"press-content\"\n  />\n</div>\n`;\n\nexports[`components/Pressable press interaction (pointer) 3`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  style=\"\"\n  tabindex=\"0\"\n/>\n`;\n\nexports[`components/Pressable prop \"accessibilityLabel\" value is set 1`] = `\n<div\n  aria-label=\"label\"\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  tabindex=\"0\"\n/>\n`;\n\nexports[`components/Pressable prop \"accessibilityLiveRegion\" value is set 1`] = `\n<div\n  aria-live=\"polite\"\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  tabindex=\"0\"\n/>\n`;\n\nexports[`components/Pressable prop \"accessibilityRole\" value alters HTML element 1`] = `\n<article\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  role=\"article\"\n  tabindex=\"0\"\n/>\n`;\n\nexports[`components/Pressable prop \"accessibilityRole\" value is \"button\" 1`] = `\n<button\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  role=\"button\"\n  tabindex=\"0\"\n  type=\"button\"\n/>\n`;\n\nexports[`components/Pressable prop \"accessibilityRole\" value is set 1`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  role=\"presentation\"\n  tabindex=\"0\"\n/>\n`;\n\nexports[`components/Pressable prop \"disabled\" 1`] = `\n<div\n  aria-disabled=\"true\"\n  class=\"css-view-g5y9jx r-pointerEvents-12vffkv\"\n  tabindex=\"-1\"\n/>\n`;\n\nexports[`components/Pressable prop \"href\" 1`] = `\n<a\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  href=\"#href\"\n  tabindex=\"0\"\n/>\n`;\n\nexports[`components/Pressable prop \"nativeID\" value is set 1`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  id=\"nativeID\"\n  tabindex=\"0\"\n/>\n`;\n\nexports[`components/Pressable prop \"pointerEvents\" 1`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73 r-pointerEvents-ah5dr5\"\n  tabindex=\"0\"\n/>\n`;\n\nexports[`components/Pressable prop \"style\" value is set 1`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  style=\"border-top-width: 5px; border-right-width: 5px; border-bottom-width: 5px; border-left-width: 5px;\"\n  tabindex=\"0\"\n/>\n`;\n\nexports[`components/Pressable prop \"testID\" value is set 1`] = `\n<div\n  class=\"css-view-g5y9jx r-cursor-1loqt21 r-touchAction-1otgn73\"\n  data-testid=\"123\"\n  tabindex=\"0\"\n/>\n`;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Pressable/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport React from 'react';\nimport Pressable from '../';\nimport { createEventTarget } from 'dom-event-testing-library';\nimport { act, render } from '@testing-library/react';\n\ndescribe('components/Pressable', () => {\n  test('default', () => {\n    const { container } = render(<Pressable />);\n    expect(container.firstChild).toMatchSnapshot();\n  });\n\n  describe('prop \"accessibilityLabel\"', () => {\n    test('value is set', () => {\n      const { container } = render(<Pressable accessibilityLabel=\"label\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"accessibilityLiveRegion\"', () => {\n    test('value is set', () => {\n      const { container } = render(\n        <Pressable accessibilityLiveRegion=\"polite\" />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"accessibilityRole\"', () => {\n    test('value is set', () => {\n      const { container } = render(<Pressable accessibilityRole=\"none\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('value is \"button\"', () => {\n      const { container } = render(<Pressable accessibilityRole=\"button\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('value alters HTML element', () => {\n      const { container } = render(<Pressable accessibilityRole=\"article\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  test('prop \"disabled\"', () => {\n    const { container } = render(<Pressable disabled={true} />);\n    expect(container.firstChild).toMatchSnapshot();\n  });\n\n  test('prop \"href\"', () => {\n    const { container } = render(<Pressable href=\"#href\" />);\n    expect(container.firstChild).toMatchSnapshot();\n  });\n\n  describe('prop \"nativeID\"', () => {\n    test('value is set', () => {\n      const { container } = render(<Pressable nativeID=\"nativeID\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  test('focus interaction', () => {\n    let container;\n    const onBlur = jest.fn();\n    const onFocus = jest.fn();\n    const ref = React.createRef();\n    act(() => {\n      ({ container } = render(\n        <Pressable\n          children={({ focused }) =>\n            focused ? <div data-testid=\"focus-content\" /> : null\n          }\n          onBlur={onBlur}\n          onFocus={onFocus}\n          ref={ref}\n          style={({ focused }) => [focused && { outline: 'focus-ring' }]}\n        />\n      ));\n    });\n    const target = createEventTarget(ref.current);\n    const body = createEventTarget(document.body);\n    expect(container.firstChild).toMatchSnapshot();\n    act(() => {\n      target.focus();\n    });\n    expect(onFocus).toBeCalled();\n    expect(container.firstChild).toMatchSnapshot();\n    act(() => {\n      body.focus({ relatedTarget: target.node });\n    });\n    expect(onBlur).toBeCalled();\n    expect(container.firstChild).toMatchSnapshot();\n  });\n\n  test('focus interaction (disabled)', () => {\n    const onBlur = jest.fn();\n    const onFocus = jest.fn();\n    const ref = React.createRef();\n    act(() => {\n      render(\n        <Pressable\n          disabled={true}\n          onBlur={onBlur}\n          onFocus={onFocus}\n          ref={ref}\n        />\n      );\n    });\n    const target = createEventTarget(ref.current);\n    const body = createEventTarget(document.body);\n    act(() => {\n      target.focus();\n    });\n    expect(onFocus).toBeCalled();\n    act(() => {\n      body.focus({ relatedTarget: target.node });\n    });\n    expect(onBlur).toBeCalled();\n  });\n\n  test('hover interaction', () => {\n    let container;\n    const onHoverIn = jest.fn();\n    const onHoverOut = jest.fn();\n    const ref = React.createRef();\n    act(() => {\n      ({ container } = render(\n        <Pressable\n          children={({ hovered }) =>\n            hovered ? <div data-testid=\"hover-content\" /> : null\n          }\n          onHoverIn={onHoverIn}\n          onHoverOut={onHoverOut}\n          ref={ref}\n          style={({ hovered }) => [hovered && { outline: 'hover-ring' }]}\n        />\n      ));\n    });\n    const target = createEventTarget(ref.current);\n    expect(container.firstChild).toMatchSnapshot();\n    act(() => {\n      target.pointerover();\n    });\n    expect(onHoverIn).toBeCalled();\n    expect(container.firstChild).toMatchSnapshot();\n    act(() => {\n      target.pointerout();\n    });\n    expect(onHoverOut).toBeCalled();\n    expect(container.firstChild).toMatchSnapshot();\n  });\n\n  test('press interaction (pointer)', () => {\n    let container;\n    const onContextMenu = jest.fn();\n    const onPress = jest.fn();\n    const onPressIn = jest.fn();\n    const onPressOut = jest.fn();\n    const ref = React.createRef();\n    act(() => {\n      ({ container } = render(\n        <Pressable\n          children={({ pressed }) =>\n            pressed ? <div data-testid=\"press-content\" /> : null\n          }\n          onContextMenu={onContextMenu}\n          onPress={onPress}\n          onPressIn={onPressIn}\n          onPressOut={onPressOut}\n          ref={ref}\n          style={({ pressed }) => [pressed && { outline: 'press-ring' }]}\n        />\n      ));\n    });\n    const target = createEventTarget(ref.current);\n    expect(container.firstChild).toMatchSnapshot();\n    act(() => {\n      target.pointerdown({ button: 0 });\n      jest.runAllTimers();\n    });\n    expect(onPressIn).toBeCalled();\n    expect(container.firstChild).toMatchSnapshot();\n    act(() => {\n      target.pointerup({ button: 0 });\n      jest.runAllTimers();\n    });\n    expect(onPressOut).toBeCalled();\n    expect(onPress).toBeCalled();\n    expect(container.firstChild).toMatchSnapshot();\n    act(() => {\n      target.contextmenu({});\n    });\n    expect(onContextMenu).toBeCalled();\n  });\n\n  describe('press interaction (keyboard)', () => {\n    test('trigger press when keyup is on the same element', () => {\n      let container;\n      const onPress = jest.fn();\n      const onPressIn = jest.fn();\n      const onPressOut = jest.fn();\n      const ref = React.createRef();\n\n      function TestCase() {\n        const [shown, setShown] = React.useState(true);\n        return shown ? (\n          <Pressable\n            children={({ pressed }) =>\n              pressed ? <div data-testid=\"press-content\" /> : null\n            }\n            onPress={(e) => {\n              onPress(e);\n              setShown(false);\n            }}\n            onPressIn={onPressIn}\n            onPressOut={onPressOut}\n            ref={ref}\n            style={({ pressed }) => [pressed && { outline: 'press-ring' }]}\n          />\n        ) : null;\n      }\n\n      act(() => {\n        ({ container } = render(<TestCase />));\n      });\n      const target = createEventTarget(ref.current);\n      expect(container.firstChild).toMatchSnapshot();\n      act(() => {\n        target.keydown({ key: 'Enter' });\n        jest.runAllTimers();\n      });\n      expect(onPressIn).toBeCalled();\n      expect(container.firstChild).toMatchSnapshot();\n      act(() => {\n        target.keyup({ key: 'Enter' });\n        jest.runAllTimers();\n      });\n      expect(onPressOut).toBeCalled();\n      expect(onPress).toBeCalled();\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('ignore press when keyup is on a different element', () => {\n      const onPress = jest.fn();\n      const firstRef = React.createRef();\n\n      function TestCase() {\n        return (\n          <Pressable\n            onPress={(e) => {\n              onPress(e);\n            }}\n            ref={firstRef}\n          />\n        );\n      }\n\n      act(() => {\n        render(<TestCase />);\n      });\n      const target = createEventTarget(firstRef.current);\n      const body = createEventTarget(document.body);\n      act(() => {\n        target.keydown({ key: 'Enter' });\n        body.keyup({ key: 'Enter' });\n        jest.runAllTimers();\n      });\n      expect(onPress).not.toBeCalled();\n    });\n  });\n\n  test('press interaction as button (keyboard)', () => {\n    const onPress = jest.fn();\n    const preventDefault = jest.fn();\n    const ref = React.createRef();\n\n    function TestCase() {\n      return (\n        <Pressable\n          onPress={(e) => {\n            onPress(e);\n          }}\n          ref={ref}\n          role=\"button\"\n        />\n      );\n    }\n\n    act(() => {\n      render(<TestCase />);\n    });\n    const target = createEventTarget(ref.current);\n    act(() => {\n      target.keydown({ key: ' ', preventDefault });\n      jest.runAllTimers();\n    });\n    // Calling preventDefault prevents native 'click' event dispatch\n    expect(preventDefault).not.toHaveBeenCalled();\n  });\n\n  describe('prop \"ref\"', () => {\n    test('value is set', () => {\n      const ref = jest.fn();\n      render(<Pressable ref={ref} />);\n      expect(ref).toBeCalled();\n    });\n\n    test('node has imperative methods', () => {\n      const ref = React.createRef();\n      act(() => {\n        render(<Pressable ref={ref} />);\n      });\n      const node = ref.current;\n      expect(typeof node.measure === 'function');\n      expect(typeof node.measureLayout === 'function');\n      expect(typeof node.measureInWindow === 'function');\n    });\n  });\n\n  test('prop \"pointerEvents\"', () => {\n    const { container } = render(<Pressable pointerEvents=\"box-only\" />);\n    expect(container.firstChild).toMatchSnapshot();\n  });\n\n  describe('prop \"style\"', () => {\n    test('value is set', () => {\n      const { container } = render(<Pressable style={{ borderWidth: 5 }} />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"testID\"', () => {\n    test('value is set', () => {\n      const { container } = render(<Pressable testID=\"123\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Pressable/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n */\n\n'use client';\n\nimport type { HoverEventsConfig } from '../../modules/useHover';\nimport type { PressResponderConfig } from '../../modules/usePressEvents/PressResponder';\nimport type { ViewProps } from '../View';\n\nimport * as React from 'react';\nimport { forwardRef, memo, useMemo, useState, useRef } from 'react';\nimport useMergeRefs from '../../modules/useMergeRefs';\nimport useHover from '../../modules/useHover';\nimport usePressEvents from '../../modules/usePressEvents';\nimport StyleSheet from '../StyleSheet';\nimport View from '../View';\n\nexport type StateCallbackType = $ReadOnly<{|\n  focused: boolean,\n  hovered: boolean,\n  pressed: boolean\n|}>;\n\ntype ViewStyleProp = $PropertyType<ViewProps, 'style'>;\n\ntype Props = {\n  ...ViewProps,\n  children: React.Node | ((state: StateCallbackType) => React.Node),\n  // Duration (in milliseconds) from `onPressIn` before `onLongPress` is called.\n  delayLongPress?: ?number,\n  // Duration (in milliseconds) from `onPressStart` is called after pointerdown\n  delayPressIn?: ?number,\n  // Duration (in milliseconds) from `onPressEnd` is called after pointerup.\n  delayPressOut?: ?number,\n  // Whether the press behavior is disabled.\n  disabled?: ?boolean,\n  // Called when the view is hovered\n  onHoverIn?: $PropertyType<HoverEventsConfig, 'onHoverStart'>,\n  // Called when the view is no longer hovered\n  onHoverOut?: $PropertyType<HoverEventsConfig, 'onHoverEnd'>,\n  // Called when this view's layout changes\n  onLayout?: $PropertyType<ViewProps, 'onLayout'>,\n  // Called when a long-tap gesture is detected.\n  onLongPress?: $PropertyType<PressResponderConfig, 'onLongPress'>,\n  // Called when a single tap gesture is detected.\n  onPress?: $PropertyType<PressResponderConfig, 'onPress'>,\n  // Called when a touch is engaged, before `onPress`.\n  onPressIn?: $PropertyType<PressResponderConfig, 'onPressStart'>,\n  // Called when a touch is moving, after `onPressIn`.\n  onPressMove?: $PropertyType<PressResponderConfig, 'onPressMove'>,\n  // Called when a touch is released, before `onPress`.\n  onPressOut?: $PropertyType<PressResponderConfig, 'onPressEnd'>,\n  style?: ViewStyleProp | ((state: StateCallbackType) => ViewStyleProp),\n  /**\n   * Used only for documentation or testing (e.g. snapshot testing).\n   */\n  testOnly_hovered?: ?boolean,\n  testOnly_pressed?: ?boolean\n};\n\n/**\n * Component used to build display components that should respond to whether the\n * component is currently pressed or not.\n */\nfunction Pressable(props: Props, forwardedRef): React.Node {\n  const {\n    children,\n    delayLongPress,\n    delayPressIn,\n    delayPressOut,\n    disabled,\n    onBlur,\n    onContextMenu,\n    onFocus,\n    onHoverIn,\n    onHoverOut,\n    onKeyDown,\n    onLongPress,\n    onPress,\n    onPressMove,\n    onPressIn,\n    onPressOut,\n    style,\n    tabIndex,\n    testOnly_hovered,\n    testOnly_pressed,\n    ...rest\n  } = props;\n\n  const [hovered, setHovered] = useForceableState(testOnly_hovered === true);\n  const [focused, setFocused] = useForceableState(false);\n  const [pressed, setPressed] = useForceableState(testOnly_pressed === true);\n\n  const hostRef = useRef(null);\n  const setRef = useMergeRefs(forwardedRef, hostRef);\n\n  const pressConfig = useMemo(\n    () => ({\n      delayLongPress,\n      delayPressStart: delayPressIn,\n      delayPressEnd: delayPressOut,\n      disabled,\n      onLongPress,\n      onPress,\n      onPressChange: setPressed,\n      onPressStart: onPressIn,\n      onPressMove,\n      onPressEnd: onPressOut\n    }),\n    [\n      delayLongPress,\n      delayPressIn,\n      delayPressOut,\n      disabled,\n      onLongPress,\n      onPress,\n      onPressIn,\n      onPressMove,\n      onPressOut,\n      setPressed\n    ]\n  );\n\n  const pressEventHandlers = usePressEvents(hostRef, pressConfig);\n\n  const { onContextMenu: onContextMenuPress, onKeyDown: onKeyDownPress } =\n    pressEventHandlers;\n\n  useHover(hostRef, {\n    contain: true,\n    disabled,\n    onHoverChange: setHovered,\n    onHoverStart: onHoverIn,\n    onHoverEnd: onHoverOut\n  });\n\n  const interactionState = { hovered, focused, pressed };\n\n  const blurHandler = React.useCallback(\n    (e) => {\n      if (e.nativeEvent.target === hostRef.current) {\n        setFocused(false);\n        if (onBlur != null) {\n          onBlur(e);\n        }\n      }\n    },\n    [hostRef, setFocused, onBlur]\n  );\n\n  const focusHandler = React.useCallback(\n    (e) => {\n      if (e.nativeEvent.target === hostRef.current) {\n        setFocused(true);\n        if (onFocus != null) {\n          onFocus(e);\n        }\n      }\n    },\n    [hostRef, setFocused, onFocus]\n  );\n\n  const contextMenuHandler = React.useCallback(\n    (e) => {\n      if (onContextMenuPress != null) {\n        onContextMenuPress(e);\n      }\n      if (onContextMenu != null) {\n        onContextMenu(e);\n      }\n    },\n    [onContextMenu, onContextMenuPress]\n  );\n\n  const keyDownHandler = React.useCallback(\n    (e) => {\n      if (onKeyDownPress != null) {\n        onKeyDownPress(e);\n      }\n      if (onKeyDown != null) {\n        onKeyDown(e);\n      }\n    },\n    [onKeyDown, onKeyDownPress]\n  );\n\n  let _tabIndex;\n  if (tabIndex !== undefined) {\n    _tabIndex = tabIndex;\n  } else {\n    _tabIndex = disabled ? -1 : 0;\n  }\n\n  return (\n    <View\n      {...rest}\n      {...pressEventHandlers}\n      aria-disabled={disabled}\n      onBlur={blurHandler}\n      onContextMenu={contextMenuHandler}\n      onFocus={focusHandler}\n      onKeyDown={keyDownHandler}\n      ref={setRef}\n      style={[\n        disabled ? styles.disabled : styles.active,\n        typeof style === 'function' ? style(interactionState) : style\n      ]}\n      tabIndex={_tabIndex}\n    >\n      {typeof children === 'function' ? children(interactionState) : children}\n    </View>\n  );\n}\n\nfunction useForceableState(forced: boolean): [boolean, (boolean) => void] {\n  const [bool, setBool] = useState(false);\n  return [bool || forced, setBool];\n}\n\nconst styles = StyleSheet.create({\n  active: {\n    cursor: 'pointer',\n    touchAction: 'manipulation'\n  },\n  disabled: {\n    pointerEvents: 'box-none'\n  }\n});\n\nconst MemoedPressable = memo(forwardRef(Pressable));\nMemoedPressable.displayName = 'Pressable';\n\nexport default (MemoedPressable: React.AbstractComponent<\n  Props,\n  React.ElementRef<typeof View>\n>);\n"
  },
  {
    "path": "packages/react-native-web/src/exports/ProgressBar/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport React from 'react';\nimport { render } from '@testing-library/react';\nimport ProgressBar from '..';\n\ndescribe('components/ProgressBar', () => {\n  describe('progress', () => {\n    test('value as percentage is set to \"aria-valuenow\"', () => {\n      const { container } = render(<ProgressBar progress={0.5} />);\n      expect(container.firstChild.getAttribute('aria-valuenow')).toBe('50');\n    });\n\n    test('is ignored when \"indeterminate\" is \"true\"', () => {\n      const { container } = render(\n        <ProgressBar indeterminate progress={0.5} />\n      );\n      expect(container.firstChild.getAttribute('aria-valuenow')).toBe(null);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/ProgressBar/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\n'use client';\n\nimport type { ColorValue } from '../../types';\nimport type { ViewProps } from '../View';\n\nimport * as React from 'react';\nimport StyleSheet from '../StyleSheet';\nimport View from '../View';\n\ntype ProgressBarProps = {\n  ...ViewProps,\n  color?: ColorValue,\n  indeterminate?: boolean,\n  progress?: number,\n  trackColor?: ColorValue\n};\n\nconst ProgressBar: React.AbstractComponent<\n  ProgressBarProps,\n  React.ElementRef<typeof View>\n> = React.forwardRef((props, ref) => {\n  const {\n    color = '#1976D2',\n    indeterminate = false,\n    progress = 0,\n    trackColor = 'transparent',\n    style,\n    ...other\n  } = props;\n\n  const percentageProgress = progress * 100;\n  const width = indeterminate ? '25%' : `${percentageProgress}%`;\n\n  return (\n    <View\n      {...other}\n      aria-valuemax={100}\n      aria-valuemin={0}\n      aria-valuenow={indeterminate ? null : percentageProgress}\n      ref={ref}\n      role=\"progressbar\"\n      style={[styles.track, style, { backgroundColor: trackColor }]}\n    >\n      <View\n        style={[\n          { backgroundColor: color, width },\n          styles.progress,\n          indeterminate && styles.animation\n        ]}\n      />\n    </View>\n  );\n});\n\nProgressBar.displayName = 'ProgressBar';\n\nconst styles = StyleSheet.create({\n  track: {\n    forcedColorAdjust: 'none',\n    height: 5,\n    overflow: 'hidden',\n    userSelect: 'none',\n    zIndex: 0\n  },\n  progress: {\n    forcedColorAdjust: 'none',\n    height: '100%',\n    zIndex: -1\n  },\n  animation: {\n    animationDuration: '1s',\n    animationKeyframes: [\n      {\n        '0%': { transform: 'translateX(-100%)' },\n        '100%': { transform: 'translateX(400%)' }\n      }\n    ],\n    animationTimingFunction: 'linear',\n    animationIterationCount: 'infinite'\n  }\n});\n\nexport default ProgressBar;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/RefreshControl/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport type { ColorValue } from '../../types';\nimport type { ViewProps } from '../View';\nimport type { Node } from 'React';\n\nimport View from '../View';\nimport React from 'react';\n\ntype RefreshControlProps = {\n  ...ViewProps,\n  colors?: Array<ColorValue>,\n  enabled?: boolean,\n  onRefresh?: () => void,\n  progressBackgroundColor?: ColorValue,\n  progressViewOffset?: number,\n  refreshing: boolean,\n  size?: 0 | 1,\n  tintColor?: ColorValue,\n  title?: string,\n  titleColor?: ColorValue\n};\n\nfunction RefreshControl(props: RefreshControlProps): Node {\n  const {\n    /* eslint-disable */\n    colors,\n    enabled,\n    onRefresh,\n    progressBackgroundColor,\n    progressViewOffset,\n    refreshing,\n    size,\n    tintColor,\n    title,\n    titleColor,\n    /* eslint-enable */\n    ...rest\n  } = props;\n\n  return <View {...rest} />;\n}\n\nexport default RefreshControl;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/SafeAreaView/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport type { ViewProps } from '../View';\n\nimport * as React from 'react';\nimport StyleSheet from '../StyleSheet';\nimport View from '../View';\nimport canUseDOM from '../../modules/canUseDom';\n\nconst cssFunction: 'constant' | 'env' = (function () {\n  if (\n    canUseDOM &&\n    window.CSS &&\n    window.CSS.supports &&\n    window.CSS.supports('top: constant(safe-area-inset-top)')\n  ) {\n    return 'constant';\n  }\n  return 'env';\n})();\n\nconst SafeAreaView: React.AbstractComponent<\n  ViewProps,\n  React.ElementRef<typeof View>\n> = React.forwardRef((props, ref) => {\n  const { style, ...rest } = props;\n  return <View {...rest} ref={ref} style={[styles.root, style]} />;\n});\n\nSafeAreaView.displayName = 'SafeAreaView';\n\nconst styles = StyleSheet.create({\n  root: {\n    paddingTop: `${cssFunction}(safe-area-inset-top)`,\n    paddingRight: `${cssFunction}(safe-area-inset-right)`,\n    paddingBottom: `${cssFunction}(safe-area-inset-bottom)`,\n    paddingLeft: `${cssFunction}(safe-area-inset-left)`\n  }\n});\n\nexport default SafeAreaView;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/ScrollView/ScrollViewBase.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nimport type { ViewProps } from '../View';\n\nimport * as React from 'react';\nimport StyleSheet from '../StyleSheet';\nimport View from '../View';\nimport useMergeRefs from '../../modules/useMergeRefs';\n\ntype Props = {\n  ...ViewProps,\n  onMomentumScrollBegin?: (e: any) => void,\n  onMomentumScrollEnd?: (e: any) => void,\n  onScroll?: (e: any) => void,\n  onScrollBeginDrag?: (e: any) => void,\n  onScrollEndDrag?: (e: any) => void,\n  onTouchMove?: (e: any) => void,\n  onWheel?: (e: any) => void,\n  scrollEnabled?: boolean,\n  scrollEventThrottle?: number,\n  showsHorizontalScrollIndicator?: boolean,\n  showsVerticalScrollIndicator?: boolean\n};\n\nfunction normalizeScrollEvent(e) {\n  return {\n    nativeEvent: {\n      contentOffset: {\n        get x() {\n          return e.target.scrollLeft;\n        },\n        get y() {\n          return e.target.scrollTop;\n        }\n      },\n      contentSize: {\n        get height() {\n          return e.target.scrollHeight;\n        },\n        get width() {\n          return e.target.scrollWidth;\n        }\n      },\n      layoutMeasurement: {\n        get height() {\n          return e.target.offsetHeight;\n        },\n        get width() {\n          return e.target.offsetWidth;\n        }\n      }\n    },\n    timeStamp: Date.now()\n  };\n}\n\nfunction shouldEmitScrollEvent(lastTick: number, eventThrottle: number) {\n  const timeSinceLastTick = Date.now() - lastTick;\n  return eventThrottle > 0 && timeSinceLastTick >= eventThrottle;\n}\n\n/**\n * Encapsulates the Web-specific scroll throttling and disabling logic\n */\nconst ScrollViewBase: React.AbstractComponent<\n  Props,\n  React.ElementRef<typeof View>\n> = React.forwardRef((props, forwardedRef) => {\n  const {\n    onScroll,\n    onTouchMove,\n    onWheel,\n    scrollEnabled = true,\n    scrollEventThrottle = 0,\n    showsHorizontalScrollIndicator,\n    showsVerticalScrollIndicator,\n    style,\n    ...rest\n  } = props;\n\n  const scrollState = React.useRef({ isScrolling: false, scrollLastTick: 0 });\n  const scrollTimeout = React.useRef(null);\n  const scrollRef = React.useRef(null);\n\n  function createPreventableScrollHandler(handler: Function) {\n    return (e: Object) => {\n      if (scrollEnabled) {\n        if (handler) {\n          handler(e);\n        }\n      }\n    };\n  }\n\n  function handleScroll(e: Object) {\n    e.stopPropagation();\n    if (e.target === scrollRef.current) {\n      e.persist();\n      // A scroll happened, so the scroll resets the scrollend timeout.\n      if (scrollTimeout.current != null) {\n        clearTimeout(scrollTimeout.current);\n      }\n      scrollTimeout.current = setTimeout(() => {\n        handleScrollEnd(e);\n      }, 100);\n      if (scrollState.current.isScrolling) {\n        // Scroll last tick may have changed, check if we need to notify\n        if (\n          shouldEmitScrollEvent(\n            scrollState.current.scrollLastTick,\n            scrollEventThrottle\n          )\n        ) {\n          handleScrollTick(e);\n        }\n      } else {\n        // Weren't scrolling, so we must have just started\n        handleScrollStart(e);\n      }\n    }\n  }\n\n  function handleScrollStart(e: Object) {\n    scrollState.current.isScrolling = true;\n    handleScrollTick(e);\n  }\n\n  function handleScrollTick(e: Object) {\n    scrollState.current.scrollLastTick = Date.now();\n    if (onScroll) {\n      onScroll(normalizeScrollEvent(e));\n    }\n  }\n\n  function handleScrollEnd(e: Object) {\n    scrollState.current.isScrolling = false;\n    if (onScroll) {\n      onScroll(normalizeScrollEvent(e));\n    }\n  }\n\n  const hideScrollbar =\n    showsHorizontalScrollIndicator === false ||\n    showsVerticalScrollIndicator === false;\n\n  return (\n    <View\n      {...rest}\n      onScroll={handleScroll}\n      onTouchMove={createPreventableScrollHandler(onTouchMove)}\n      onWheel={createPreventableScrollHandler(onWheel)}\n      ref={useMergeRefs(scrollRef, forwardedRef)}\n      style={[\n        style,\n        !scrollEnabled && styles.scrollDisabled,\n        hideScrollbar && styles.hideScrollbar\n      ]}\n    />\n  );\n});\n\n// Chrome doesn't support e.preventDefault in this case; touch-action must be\n// used to disable scrolling.\n// https://developers.google.com/web/updates/2017/01/scrolling-intervention\nconst styles = StyleSheet.create({\n  scrollDisabled: {\n    overflowX: 'hidden',\n    overflowY: 'hidden',\n    touchAction: 'none'\n  },\n  hideScrollbar: {\n    scrollbarWidth: 'none'\n  }\n});\n\nexport default ScrollViewBase;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/ScrollView/__tests__/__snapshots__/index-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`components/ScrollView prop \"centerContent\" with 1`] = `\n<div\n  class=\"css-view-g5y9jx r-WebkitOverflowScrolling-150rngu r-flexDirection-eqz5dr r-flexGrow-16y2uox r-flexShrink-1wbh5a2 r-overflowX-11yh6sk r-overflowY-1rnoaur r-transform-agouwx\"\n  style=\"background-color: rgb(0, 0, 255);\"\n>\n  <div\n    class=\"css-view-g5y9jx r-flexGrow-16y2uox r-justifyContent-1777fci\"\n  />\n</div>\n`;\n\nexports[`components/ScrollView prop \"centerContent\" without 1`] = `\n<div\n  class=\"css-view-g5y9jx r-WebkitOverflowScrolling-150rngu r-flexDirection-eqz5dr r-flexGrow-16y2uox r-flexShrink-1wbh5a2 r-overflowX-11yh6sk r-overflowY-1rnoaur r-transform-agouwx\"\n  style=\"background-color: rgb(0, 0, 255);\"\n>\n  <div\n    class=\"css-view-g5y9jx\"\n  />\n</div>\n`;\n\nexports[`components/ScrollView prop \"refreshControl\" with 1`] = `\n<div\n  id=\"refresh-control\"\n>\n  <div\n    class=\"css-view-g5y9jx r-WebkitOverflowScrolling-150rngu r-flexDirection-eqz5dr r-flexGrow-16y2uox r-flexShrink-1wbh5a2 r-overflowX-11yh6sk r-overflowY-1rnoaur r-transform-agouwx\"\n    style=\"background-color: rgb(255, 0, 0);\"\n  >\n    <div\n      class=\"css-view-g5y9jx\"\n    />\n  </div>\n</div>\n`;\n\nexports[`components/ScrollView prop \"refreshControl\" without 1`] = `\n<div\n  class=\"css-view-g5y9jx r-WebkitOverflowScrolling-150rngu r-flexDirection-eqz5dr r-flexGrow-16y2uox r-flexShrink-1wbh5a2 r-overflowX-11yh6sk r-overflowY-1rnoaur r-transform-agouwx\"\n  style=\"background-color: rgb(255, 0, 0);\"\n>\n  <div\n    class=\"css-view-g5y9jx\"\n  />\n</div>\n`;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/ScrollView/__tests__/index-test.js",
    "content": "import React from 'react';\nimport ScrollView from '../';\nimport { createEventTarget } from 'dom-event-testing-library';\nimport { findDOMNode } from 'react-dom';\nimport { act, render } from '@testing-library/react';\n\ndescribe('components/ScrollView', () => {\n  describe('prop \"centerContent\"', () => {\n    test('without', () => {\n      const { container } = render(\n        <ScrollView style={{ backgroundColor: 'blue' }} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('with', () => {\n      const { container } = render(\n        <ScrollView centerContent style={{ backgroundColor: 'blue' }} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"onScroll\"', () => {\n    test('is called when element scrolls', () => {\n      const onScroll = jest.fn();\n      const ref = React.createRef();\n      act(() => {\n        render(\n          <ScrollView onScroll={onScroll} ref={ref} scrollEventThrottle={16} />\n        );\n      });\n      const target = createEventTarget(findDOMNode(ref.current));\n      act(() => {\n        target.scroll();\n        target.scroll();\n      });\n      expect(onScroll).toBeCalled();\n    });\n\n    test('is not called when descendant scrolls', () => {\n      const onScroll = jest.fn();\n      const ref = React.createRef();\n      act(() => {\n        render(\n          <ScrollView onScroll={onScroll} scrollEventThrottle={16}>\n            <div ref={ref} />\n          </ScrollView>\n        );\n      });\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.scroll();\n      });\n      expect(onScroll).not.toBeCalled();\n    });\n  });\n\n  describe('prop \"ref\"', () => {\n    test('value is set', () => {\n      const ref = jest.fn();\n      render(<ScrollView ref={ref} />);\n      expect(ref).toBeCalled();\n    });\n\n    test('is not called for prop changes', () => {\n      const ref = jest.fn();\n      let rerender;\n      act(() => {\n        ({ rerender } = render(\n          <ScrollView id=\"123\" ref={ref} style={{ borderWidth: 5 }} />\n        ));\n      });\n      expect(ref).toHaveBeenCalledTimes(1);\n      act(() => {\n        rerender(<ScrollView id=\"1234\" ref={ref} style={{ borderWidth: 6 }} />);\n      });\n      expect(ref).toHaveBeenCalledTimes(1);\n    });\n\n    test('node has imperative methods', () => {\n      const ref = React.createRef();\n      act(() => {\n        render(<ScrollView ref={ref} />);\n      });\n      const node = ref.current;\n\n      // Did we get an HTMLElement?\n      expect(node.tagName === 'DIV').toBe(true);\n      // Does it have the \"platform\" methods?\n      expect(typeof node.measure === 'function').toBe(true);\n      expect(typeof node.measureLayout === 'function').toBe(true);\n      expect(typeof node.measureInWindow === 'function').toBe(true);\n      // Does it have the scrollview methods?\n      expect(typeof node.getScrollResponder === 'function').toBe(true);\n      expect(typeof node.getScrollableNode === 'function').toBe(true);\n      expect(typeof node.getInnerViewNode === 'function').toBe(true);\n      expect(typeof node.getInnerViewRef === 'function').toBe(true);\n      expect(typeof node.getNativeScrollRef === 'function').toBe(true);\n      expect(typeof node.scrollTo === 'function').toBe(true);\n      expect(typeof node.scrollToEnd === 'function').toBe(true);\n      expect(typeof node.flashScrollIndicators === 'function').toBe(true);\n      expect(typeof node.scrollResponderZoomTo === 'function').toBe(true);\n      expect(\n        typeof node.scrollResponderScrollNativeHandleToKeyboard === 'function'\n      ).toBe(true);\n    });\n  });\n\n  describe('prop \"refreshControl\"', () => {\n    test('without', () => {\n      const { container } = render(\n        <ScrollView style={{ backgroundColor: 'red' }} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('with', () => {\n      const { container } = render(\n        <ScrollView\n          refreshControl={<div id=\"refresh-control\" />}\n          style={{ backgroundColor: 'red' }}\n        />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/ScrollView/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @noflow\n */\n\n'use client';\n\nimport type { ViewProps, ViewStyle } from '../View/types';\n\nimport Dimensions from '../Dimensions';\nimport dismissKeyboard from '../../modules/dismissKeyboard';\nimport invariant from 'fbjs/lib/invariant';\nimport mergeRefs from '../../modules/mergeRefs';\nimport Platform from '../Platform';\nimport ScrollViewBase from './ScrollViewBase';\nimport StyleSheet from '../StyleSheet';\nimport TextInputState from '../../modules/TextInputState';\nimport UIManager from '../UIManager';\nimport View from '../View';\nimport React from 'react';\nimport warning from 'fbjs/lib/warning';\n\ntype ScrollViewProps = {\n  ...ViewProps,\n  centerContent?: boolean,\n  contentContainerStyle?: ViewStyle,\n  horizontal?: boolean,\n  keyboardDismissMode?: 'none' | 'interactive' | 'on-drag',\n  onContentSizeChange?: (e: any) => void,\n  onScroll?: (e: any) => void,\n  pagingEnabled?: boolean,\n  refreshControl?: any,\n  scrollEnabled?: boolean,\n  scrollEventThrottle?: number,\n  stickyHeaderIndices?: Array<number>\n};\n\ntype Event = Object;\n\nconst emptyObject = {};\nconst IS_ANIMATING_TOUCH_START_THRESHOLD_MS = 16;\n\nclass ScrollView extends React.Component<ScrollViewProps> {\n  _scrollNodeRef: any = null;\n  _innerViewRef: any = null;\n\n  /**\n   * ------------------------------------------------------\n   * START SCROLLRESPONDER\n   * ------------------------------------------------------\n   */\n  isTouching: boolean = false;\n  lastMomentumScrollBeginTime: number = 0;\n  lastMomentumScrollEndTime: number = 0;\n  // Reset to false every time becomes responder. This is used to:\n  // - Determine if the scroll view has been scrolled and therefore should\n  // refuse to give up its responder lock.\n  // - Determine if releasing should dismiss the keyboard when we are in\n  // tap-to-dismiss mode (!this.props.keyboardShouldPersistTaps).\n  observedScrollSinceBecomingResponder: boolean = false;\n  becameResponderWhileAnimating: boolean = false;\n\n  /**\n   * Invoke this from an `onScroll` event.\n   */\n  scrollResponderHandleScrollShouldSetResponder: boolean = () => {\n    return this.isTouching;\n  };\n\n  /**\n   * Merely touch starting is not sufficient for a scroll view to become the\n   * responder. Being the \"responder\" means that the very next touch move/end\n   * event will result in an action/movement.\n   *\n   * Invoke this from an `onStartShouldSetResponder` event.\n   *\n   * `onStartShouldSetResponder` is used when the next move/end will trigger\n   * some UI movement/action, but when you want to yield priority to views\n   * nested inside of the view.\n   *\n   * There may be some cases where scroll views actually should return `true`\n   * from `onStartShouldSetResponder`: Any time we are detecting a standard tap\n   * that gives priority to nested views.\n   *\n   * - If a single tap on the scroll view triggers an action such as\n   *   recentering a map style view yet wants to give priority to interaction\n   *   views inside (such as dropped pins or labels), then we would return true\n   *   from this method when there is a single touch.\n   *\n   * - Similar to the previous case, if a two finger \"tap\" should trigger a\n   *   zoom, we would check the `touches` count, and if `>= 2`, we would return\n   *   true.\n   *\n   */\n  scrollResponderHandleStartShouldSetResponder(): boolean {\n    return false;\n  }\n\n  /**\n   * There are times when the scroll view wants to become the responder\n   * (meaning respond to the next immediate `touchStart/touchEnd`), in a way\n   * that *doesn't* give priority to nested views (hence the capture phase):\n   *\n   * - Currently animating.\n   * - Tapping anywhere that is not the focused input, while the keyboard is\n   *   up (which should dismiss the keyboard).\n   *\n   * Invoke this from an `onStartShouldSetResponderCapture` event.\n   */\n  scrollResponderHandleStartShouldSetResponderCapture: boolean = (e: Event) => {\n    // First see if we want to eat taps while the keyboard is up\n    // var currentlyFocusedTextInput = TextInputState.currentlyFocusedField();\n    // if (!this.props.keyboardShouldPersistTaps &&\n    //   currentlyFocusedTextInput != null &&\n    //   e.target !== currentlyFocusedTextInput) {\n    //   return true;\n    // }\n    return this.scrollResponderIsAnimating();\n  };\n\n  /**\n   * Invoke this from an `onResponderReject` event.\n   *\n   * Some other element is not yielding its role as responder. Normally, we'd\n   * just disable the `UIScrollView`, but a touch has already began on it, the\n   * `UIScrollView` will not accept being disabled after that. The easiest\n   * solution for now is to accept the limitation of disallowing this\n   * altogether. To improve this, find a way to disable the `UIScrollView` after\n   * a touch has already started.\n   */\n  scrollResponderHandleResponderReject() {\n    warning(false, \"ScrollView doesn't take rejection well - scrolls anyway\");\n  }\n\n  /**\n   * We will allow the scroll view to give up its lock iff it acquired the lock\n   * during an animation. This is a very useful default that happens to satisfy\n   * many common user experiences.\n   *\n   * - Stop a scroll on the left edge, then turn that into an outer view's\n   *   backswipe.\n   * - Stop a scroll mid-bounce at the top, continue pulling to have the outer\n   *   view dismiss.\n   * - However, without catching the scroll view mid-bounce (while it is\n   *   motionless), if you drag far enough for the scroll view to become\n   *   responder (and therefore drag the scroll view a bit), any backswipe\n   *   navigation of a swipe gesture higher in the view hierarchy, should be\n   *   rejected.\n   */\n  scrollResponderHandleTerminationRequest: boolean = () => {\n    return !this.observedScrollSinceBecomingResponder;\n  };\n\n  /**\n   * Invoke this from an `onTouchEnd` event.\n   *\n   * @param {SyntheticEvent} e Event.\n   */\n  scrollResponderHandleTouchEnd = (e: Event) => {\n    const nativeEvent = e.nativeEvent;\n    this.isTouching = nativeEvent.touches.length !== 0;\n    this.props.onTouchEnd && this.props.onTouchEnd(e);\n  };\n\n  /**\n   * Invoke this from an `onResponderRelease` event.\n   */\n  scrollResponderHandleResponderRelease = (e: Event) => {\n    this.props.onResponderRelease && this.props.onResponderRelease(e);\n\n    // By default scroll views will unfocus a textField\n    // if another touch occurs outside of it\n    const currentlyFocusedTextInput = TextInputState.currentlyFocusedField();\n    if (\n      !this.props.keyboardShouldPersistTaps &&\n      currentlyFocusedTextInput != null &&\n      e.target !== currentlyFocusedTextInput &&\n      !this.observedScrollSinceBecomingResponder &&\n      !this.becameResponderWhileAnimating\n    ) {\n      this.props.onScrollResponderKeyboardDismissed &&\n        this.props.onScrollResponderKeyboardDismissed(e);\n      TextInputState.blurTextInput(currentlyFocusedTextInput);\n    }\n  };\n\n  scrollResponderHandleScroll = (e: Event) => {\n    this.observedScrollSinceBecomingResponder = true;\n    this.props.onScroll && this.props.onScroll(e);\n  };\n\n  /**\n   * Invoke this from an `onResponderGrant` event.\n   */\n  scrollResponderHandleResponderGrant = (e: Event) => {\n    this.observedScrollSinceBecomingResponder = false;\n    this.props.onResponderGrant && this.props.onResponderGrant(e);\n    this.becameResponderWhileAnimating = this.scrollResponderIsAnimating();\n  };\n\n  /**\n   * Unfortunately, `onScrollBeginDrag` also fires when *stopping* the scroll\n   * animation, and there's not an easy way to distinguish a drag vs. stopping\n   * momentum.\n   *\n   * Invoke this from an `onScrollBeginDrag` event.\n   */\n  scrollResponderHandleScrollBeginDrag = (e: Event) => {\n    this.props.onScrollBeginDrag && this.props.onScrollBeginDrag(e);\n  };\n\n  /**\n   * Invoke this from an `onScrollEndDrag` event.\n   */\n  scrollResponderHandleScrollEndDrag = (e: Event) => {\n    this.props.onScrollEndDrag && this.props.onScrollEndDrag(e);\n  };\n\n  /**\n   * Invoke this from an `onMomentumScrollBegin` event.\n   */\n  scrollResponderHandleMomentumScrollBegin = (e: Event) => {\n    this.lastMomentumScrollBeginTime = Date.now();\n    this.props.onMomentumScrollBegin && this.props.onMomentumScrollBegin(e);\n  };\n\n  /**\n   * Invoke this from an `onMomentumScrollEnd` event.\n   */\n  scrollResponderHandleMomentumScrollEnd = (e: Event) => {\n    this.lastMomentumScrollEndTime = Date.now();\n    this.props.onMomentumScrollEnd && this.props.onMomentumScrollEnd(e);\n  };\n\n  /**\n   * Invoke this from an `onTouchStart` event.\n   *\n   * Since we know that the `SimpleEventPlugin` occurs later in the plugin\n   * order, after `ResponderEventPlugin`, we can detect that we were *not*\n   * permitted to be the responder (presumably because a contained view became\n   * responder). The `onResponderReject` won't fire in that case - it only\n   * fires when a *current* responder rejects our request.\n   *\n   * @param {SyntheticEvent} e Touch Start event.\n   */\n  scrollResponderHandleTouchStart = (e: Event) => {\n    this.isTouching = true;\n    this.props.onTouchStart && this.props.onTouchStart(e);\n  };\n\n  /**\n   * Invoke this from an `onTouchMove` event.\n   *\n   * Since we know that the `SimpleEventPlugin` occurs later in the plugin\n   * order, after `ResponderEventPlugin`, we can detect that we were *not*\n   * permitted to be the responder (presumably because a contained view became\n   * responder). The `onResponderReject` won't fire in that case - it only\n   * fires when a *current* responder rejects our request.\n   *\n   * @param {SyntheticEvent} e Touch Start event.\n   */\n  scrollResponderHandleTouchMove = (e: Event) => {\n    this.props.onTouchMove && this.props.onTouchMove(e);\n  };\n\n  /**\n   * A helper function for this class that lets us quickly determine if the\n   * view is currently animating. This is particularly useful to know when\n   * a touch has just started or ended.\n   */\n  scrollResponderIsAnimating: boolean = () => {\n    const now = Date.now();\n    const timeSinceLastMomentumScrollEnd = now - this.lastMomentumScrollEndTime;\n    const isAnimating =\n      timeSinceLastMomentumScrollEnd < IS_ANIMATING_TOUCH_START_THRESHOLD_MS ||\n      this.lastMomentumScrollEndTime < this.lastMomentumScrollBeginTime;\n    return isAnimating;\n  };\n\n  /**\n   * A helper function to scroll to a specific point in the scrollview.\n   * This is currently used to help focus on child textviews, but can also\n   * be used to quickly scroll to any element we want to focus. Syntax:\n   *\n   * scrollResponderScrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true})\n   *\n   * Note: The weird argument signature is due to the fact that, for historical reasons,\n   * the function also accepts separate arguments as as alternative to the options object.\n   * This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED.\n   */\n  scrollResponderScrollTo = (\n    x?: number | { x?: number, y?: number, animated?: boolean },\n    y?: number,\n    animated?: boolean\n  ) => {\n    if (typeof x === 'number') {\n      console.warn(\n        '`scrollResponderScrollTo(x, y, animated)` is deprecated. Use `scrollResponderScrollTo({x: 5, y: 5, animated: true})` instead.'\n      );\n    } else {\n      ({ x, y, animated } = x || emptyObject);\n    }\n    const node = this.getScrollableNode();\n    const left = x || 0;\n    const top = y || 0;\n    if (node != null) {\n      if (typeof node.scroll === 'function') {\n        node.scroll({ top, left, behavior: !animated ? 'auto' : 'smooth' });\n      } else {\n        node.scrollLeft = left;\n        node.scrollTop = top;\n      }\n    }\n  };\n\n  /**\n   * A helper function to zoom to a specific rect in the scrollview. The argument has the shape\n   * {x: number; y: number; width: number; height: number; animated: boolean = true}\n   *\n   * @platform ios\n   */\n  scrollResponderZoomTo = (\n    rect: {\n      x: number,\n      y: number,\n      width: number,\n      height: number,\n      animated?: boolean\n    },\n    animated?: boolean // deprecated, put this inside the rect argument instead\n  ) => {\n    if (Platform.OS !== 'ios') {\n      invariant('zoomToRect is not implemented');\n    }\n  };\n\n  /**\n   * Displays the scroll indicators momentarily.\n   */\n  scrollResponderFlashScrollIndicators() {}\n\n  /**\n   * This method should be used as the callback to onFocus in a TextInputs'\n   * parent view. Note that any module using this mixin needs to return\n   * the parent view's ref in getScrollViewRef() in order to use this method.\n   * @param {any} nodeHandle The TextInput node handle\n   * @param {number} additionalOffset The scroll view's top \"contentInset\".\n   *        Default is 0.\n   * @param {bool} preventNegativeScrolling Whether to allow pulling the content\n   *        down to make it meet the keyboard's top. Default is false.\n   */\n  scrollResponderScrollNativeHandleToKeyboard = (\n    nodeHandle: any,\n    additionalOffset?: number,\n    preventNegativeScrollOffset?: boolean\n  ) => {\n    this.additionalScrollOffset = additionalOffset || 0;\n    this.preventNegativeScrollOffset = !!preventNegativeScrollOffset;\n    UIManager.measureLayout(\n      nodeHandle,\n      this.getInnerViewNode(),\n      this.scrollResponderTextInputFocusError,\n      this.scrollResponderInputMeasureAndScrollToKeyboard\n    );\n  };\n\n  /**\n   * The calculations performed here assume the scroll view takes up the entire\n   * screen - even if has some content inset. We then measure the offsets of the\n   * keyboard, and compensate both for the scroll view's \"contentInset\".\n   *\n   * @param {number} left Position of input w.r.t. table view.\n   * @param {number} top Position of input w.r.t. table view.\n   * @param {number} width Width of the text input.\n   * @param {number} height Height of the text input.\n   */\n  scrollResponderInputMeasureAndScrollToKeyboard = (\n    left: number,\n    top: number,\n    width: number,\n    height: number\n  ) => {\n    let keyboardScreenY = Dimensions.get('window').height;\n    if (this.keyboardWillOpenTo) {\n      keyboardScreenY = this.keyboardWillOpenTo.endCoordinates.screenY;\n    }\n    let scrollOffsetY =\n      top - keyboardScreenY + height + this.additionalScrollOffset;\n\n    // By default, this can scroll with negative offset, pulling the content\n    // down so that the target component's bottom meets the keyboard's top.\n    // If requested otherwise, cap the offset at 0 minimum to avoid content\n    // shifting down.\n    if (this.preventNegativeScrollOffset) {\n      scrollOffsetY = Math.max(0, scrollOffsetY);\n    }\n    this.scrollResponderScrollTo({ x: 0, y: scrollOffsetY, animated: true });\n\n    this.additionalOffset = 0;\n    this.preventNegativeScrollOffset = false;\n  };\n\n  scrollResponderTextInputFocusError(e: Event) {\n    console.error('Error measuring text field: ', e);\n  }\n\n  /**\n   * Warning, this may be called several times for a single keyboard opening.\n   * It's best to store the information in this method and then take any action\n   * at a later point (either in `keyboardDidShow` or other).\n   *\n   * Here's the order that events occur in:\n   * - focus\n   * - willShow {startCoordinates, endCoordinates} several times\n   * - didShow several times\n   * - blur\n   * - willHide {startCoordinates, endCoordinates} several times\n   * - didHide several times\n   *\n   * The `ScrollResponder` providesModule callbacks for each of these events.\n   * Even though any user could have easily listened to keyboard events\n   * themselves, using these `props` callbacks ensures that ordering of events\n   * is consistent - and not dependent on the order that the keyboard events are\n   * subscribed to. This matters when telling the scroll view to scroll to where\n   * the keyboard is headed - the scroll responder better have been notified of\n   * the keyboard destination before being instructed to scroll to where the\n   * keyboard will be. Stick to the `ScrollResponder` callbacks, and everything\n   * will work.\n   *\n   * WARNING: These callbacks will fire even if a keyboard is displayed in a\n   * different navigation pane. Filter out the events to determine if they are\n   * relevant to you. (For example, only if you receive these callbacks after\n   * you had explicitly focused a node etc).\n   */\n  scrollResponderKeyboardWillShow = (e: Event) => {\n    this.keyboardWillOpenTo = e;\n    this.props.onKeyboardWillShow && this.props.onKeyboardWillShow(e);\n  };\n\n  scrollResponderKeyboardWillHide = (e: Event) => {\n    this.keyboardWillOpenTo = null;\n    this.props.onKeyboardWillHide && this.props.onKeyboardWillHide(e);\n  };\n\n  scrollResponderKeyboardDidShow = (e: Event) => {\n    // TODO(7693961): The event for DidShow is not available on iOS yet.\n    // Use the one from WillShow and do not assign.\n    if (e) {\n      this.keyboardWillOpenTo = e;\n    }\n    this.props.onKeyboardDidShow && this.props.onKeyboardDidShow(e);\n  };\n\n  scrollResponderKeyboardDidHide = (e: Event) => {\n    this.keyboardWillOpenTo = null;\n    this.props.onKeyboardDidHide && this.props.onKeyboardDidHide(e);\n  };\n\n  /**\n   * ------------------------------------------------------\n   * END SCROLLRESPONDER\n   * ------------------------------------------------------\n   */\n\n  flashScrollIndicators = () => {\n    this.scrollResponderFlashScrollIndicators();\n  };\n\n  /**\n   * Returns a reference to the underlying scroll responder, which supports\n   * operations like `scrollTo`. All ScrollView-like components should\n   * implement this method so that they can be composed while providing access\n   * to the underlying scroll responder's methods.\n   */\n  getScrollResponder: ScrollView = () => {\n    return this;\n  };\n\n  getScrollableNode = () => {\n    return this._scrollNodeRef;\n  };\n\n  getInnerViewRef = () => {\n    return this._innerViewRef;\n  };\n\n  getInnerViewNode = () => {\n    return this._innerViewRef;\n  };\n\n  getNativeScrollRef = () => {\n    return this._scrollNodeRef;\n  };\n\n  /**\n   * Scrolls to a given x, y offset, either immediately or with a smooth animation.\n   * Syntax:\n   *\n   * scrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true})\n   *\n   * Note: The weird argument signature is due to the fact that, for historical reasons,\n   * the function also accepts separate arguments as as alternative to the options object.\n   * This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED.\n   */\n  scrollTo = (\n    y?: number | { x?: number, y?: number, animated?: boolean },\n    x?: number,\n    animated?: boolean\n  ) => {\n    if (typeof y === 'number') {\n      console.warn(\n        '`scrollTo(y, x, animated)` is deprecated. Use `scrollTo({x: 5, y: 5, animated: true})` instead.'\n      );\n    } else {\n      ({ x, y, animated } = y || emptyObject);\n    }\n\n    this.scrollResponderScrollTo({\n      x: x || 0,\n      y: y || 0,\n      animated: animated !== false\n    });\n  };\n\n  /**\n   * If this is a vertical ScrollView scrolls to the bottom.\n   * If this is a horizontal ScrollView scrolls to the right.\n   *\n   * Use `scrollToEnd({ animated: true })` for smooth animated scrolling,\n   * `scrollToEnd({ animated: false })` for immediate scrolling.\n   * If no options are passed, `animated` defaults to true.\n   */\n  scrollToEnd = (options?: { animated?: boolean }) => {\n    // Default to true\n    const animated = (options && options.animated) !== false;\n    const { horizontal } = this.props;\n    const scrollResponderNode = this.getScrollableNode();\n    const x = horizontal ? scrollResponderNode.scrollWidth : 0;\n    const y = horizontal ? 0 : scrollResponderNode.scrollHeight;\n    this.scrollResponderScrollTo({ x, y, animated });\n  };\n\n  render() {\n    const {\n      contentContainerStyle,\n      horizontal,\n      onContentSizeChange,\n      refreshControl,\n      stickyHeaderIndices,\n      pagingEnabled,\n      /* eslint-disable */\n      forwardedRef,\n      keyboardDismissMode,\n      onScroll,\n      centerContent,\n      /* eslint-enable */\n      ...other\n    } = this.props;\n\n    if (process.env.NODE_ENV !== 'production' && this.props.style) {\n      const style = StyleSheet.flatten(this.props.style);\n      const childLayoutProps = ['alignItems', 'justifyContent'].filter(\n        (prop) => style && style[prop] !== undefined\n      );\n      invariant(\n        childLayoutProps.length === 0,\n        `ScrollView child layout (${JSON.stringify(childLayoutProps)}) ` +\n          'must be applied through the contentContainerStyle prop.'\n      );\n    }\n\n    let contentSizeChangeProps = {};\n    if (onContentSizeChange) {\n      contentSizeChangeProps = {\n        onLayout: this._handleContentOnLayout\n      };\n    }\n\n    const hasStickyHeaderIndices =\n      !horizontal && Array.isArray(stickyHeaderIndices);\n    const children =\n      hasStickyHeaderIndices || pagingEnabled\n        ? React.Children.map(this.props.children, (child, i) => {\n            const isSticky =\n              hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;\n            if (child != null && (isSticky || pagingEnabled)) {\n              return (\n                <View\n                  style={[\n                    isSticky && styles.stickyHeader,\n                    pagingEnabled && styles.pagingEnabledChild\n                  ]}\n                >\n                  {child}\n                </View>\n              );\n            } else {\n              return child;\n            }\n          })\n        : this.props.children;\n\n    const contentContainer = (\n      <View\n        {...contentSizeChangeProps}\n        children={children}\n        collapsable={false}\n        ref={this._setInnerViewRef}\n        style={[\n          horizontal && styles.contentContainerHorizontal,\n          centerContent && styles.contentContainerCenterContent,\n          contentContainerStyle\n        ]}\n      />\n    );\n\n    const baseStyle = horizontal ? styles.baseHorizontal : styles.baseVertical;\n    const pagingEnabledStyle = horizontal\n      ? styles.pagingEnabledHorizontal\n      : styles.pagingEnabledVertical;\n\n    const props = {\n      ...other,\n      style: [baseStyle, pagingEnabled && pagingEnabledStyle, this.props.style],\n      onTouchStart: this.scrollResponderHandleTouchStart,\n      onTouchMove: this.scrollResponderHandleTouchMove,\n      onTouchEnd: this.scrollResponderHandleTouchEnd,\n      onScrollBeginDrag: this.scrollResponderHandleScrollBeginDrag,\n      onScrollEndDrag: this.scrollResponderHandleScrollEndDrag,\n      onMomentumScrollBegin: this.scrollResponderHandleMomentumScrollBegin,\n      onMomentumScrollEnd: this.scrollResponderHandleMomentumScrollEnd,\n      onStartShouldSetResponder:\n        this.scrollResponderHandleStartShouldSetResponder,\n      onStartShouldSetResponderCapture:\n        this.scrollResponderHandleStartShouldSetResponderCapture,\n      onScrollShouldSetResponder:\n        this.scrollResponderHandleScrollShouldSetResponder,\n      onScroll: this._handleScroll,\n      onResponderGrant: this.scrollResponderHandleResponderGrant,\n      onResponderTerminationRequest:\n        this.scrollResponderHandleTerminationRequest,\n      onResponderTerminate: this.scrollResponderHandleTerminate,\n      onResponderRelease: this.scrollResponderHandleResponderRelease,\n      onResponderReject: this.scrollResponderHandleResponderReject\n    };\n\n    const ScrollViewClass = ScrollViewBase;\n\n    invariant(\n      ScrollViewClass !== undefined,\n      'ScrollViewClass must not be undefined'\n    );\n\n    const scrollView = (\n      <ScrollViewClass {...props} ref={this._setScrollNodeRef}>\n        {contentContainer}\n      </ScrollViewClass>\n    );\n\n    if (refreshControl) {\n      return React.cloneElement(\n        refreshControl,\n        { style: props.style },\n        scrollView\n      );\n    }\n\n    return scrollView;\n  }\n\n  _handleContentOnLayout = (e: Object) => {\n    const { width, height } = e.nativeEvent.layout;\n    this.props.onContentSizeChange(width, height);\n  };\n\n  _handleScroll = (e: Object) => {\n    if (process.env.NODE_ENV !== 'production') {\n      if (this.props.onScroll && this.props.scrollEventThrottle == null) {\n        console.log(\n          'You specified `onScroll` on a <ScrollView> but not ' +\n            '`scrollEventThrottle`. You will only receive one event. ' +\n            'Using `16` you get all the events but be aware that it may ' +\n            \"cause frame drops, use a bigger number if you don't need as \" +\n            'much precision.'\n        );\n      }\n    }\n\n    if (this.props.keyboardDismissMode === 'on-drag') {\n      dismissKeyboard();\n    }\n\n    this.scrollResponderHandleScroll(e);\n  };\n\n  _setInnerViewRef = (node) => {\n    this._innerViewRef = node;\n  };\n\n  _setScrollNodeRef = (node) => {\n    this._scrollNodeRef = node;\n    // ScrollView needs to add more methods to the hostNode in addition to those\n    // added by `usePlatformMethods`. This is temporarily until an API like\n    // `ScrollView.scrollTo(hostNode, { x, y })` is added to React Native.\n    if (node != null) {\n      node.getScrollResponder = this.getScrollResponder;\n      node.getInnerViewNode = this.getInnerViewNode;\n      node.getInnerViewRef = this.getInnerViewRef;\n      node.getNativeScrollRef = this.getNativeScrollRef;\n      node.getScrollableNode = this.getScrollableNode;\n      node.scrollTo = this.scrollTo;\n      node.scrollToEnd = this.scrollToEnd;\n      node.flashScrollIndicators = this.flashScrollIndicators;\n      node.scrollResponderZoomTo = this.scrollResponderZoomTo;\n      node.scrollResponderScrollNativeHandleToKeyboard =\n        this.scrollResponderScrollNativeHandleToKeyboard;\n    }\n    const ref = mergeRefs(this.props.forwardedRef);\n    ref(node);\n  };\n}\n\nconst commonStyle = {\n  flexGrow: 1,\n  flexShrink: 1,\n  // Enable hardware compositing in modern browsers.\n  // Creates a new layer with its own backing surface that can significantly\n  // improve scroll performance.\n  transform: 'translateZ(0)',\n  // iOS native scrolling\n  WebkitOverflowScrolling: 'touch'\n};\n\nconst styles = StyleSheet.create({\n  baseVertical: {\n    ...commonStyle,\n    flexDirection: 'column',\n    overflowX: 'hidden',\n    overflowY: 'auto'\n  },\n  baseHorizontal: {\n    ...commonStyle,\n    flexDirection: 'row',\n    overflowX: 'auto',\n    overflowY: 'hidden'\n  },\n  contentContainerHorizontal: {\n    flexDirection: 'row'\n  },\n  contentContainerCenterContent: {\n    justifyContent: 'center',\n    flexGrow: 1\n  },\n  stickyHeader: {\n    position: 'sticky',\n    top: 0,\n    zIndex: 10\n  },\n  pagingEnabledHorizontal: {\n    scrollSnapType: 'x mandatory'\n  },\n  pagingEnabledVertical: {\n    scrollSnapType: 'y mandatory'\n  },\n  pagingEnabledChild: {\n    scrollSnapAlign: 'start'\n  }\n});\n\nconst ForwardedScrollView: React.AbstractComponent<\n  React.ElementConfig<typeof ScrollView>,\n  React.ElementRef<typeof ScrollView>\n> = React.forwardRef((props, forwardedRef) => {\n  return <ScrollView {...props} forwardedRef={forwardedRef} />;\n});\n\nForwardedScrollView.displayName = 'ScrollView';\n\nexport default ForwardedScrollView;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/SectionList/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use client';\n\nimport SectionList from '../../vendor/react-native/SectionList';\nexport default SectionList;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Share/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport invariant from 'fbjs/lib/invariant';\n\ntype Content =\n  | { title?: string, message?: string, url: string }\n  | { title?: string, message: string, url?: string };\n\nclass Share {\n  static share(content: Content, options: Object = {}): Promise<Object> {\n    invariant(\n      typeof content === 'object' && content !== null,\n      'Content to share must be a valid object'\n    );\n    invariant(\n      typeof content.url === 'string' || typeof content.message === 'string',\n      'At least one of URL and message is required'\n    );\n    invariant(\n      typeof options === 'object' && options !== null,\n      'Options must be a valid object'\n    );\n    invariant(\n      !content.title || typeof content.title === 'string',\n      'Invalid title: title should be a string.'\n    );\n\n    if (window.navigator.share !== undefined) {\n      return window.navigator.share({\n        title: content.title,\n        text: content.message,\n        url: content.url\n      });\n    } else {\n      return Promise.reject(\n        new Error('Share is not supported in this browser')\n      );\n    }\n  }\n\n  /**\n   * The content was successfully shared.\n   */\n  static get sharedAction(): string {\n    return 'sharedAction';\n  }\n\n  /**\n   * The dialog has been dismissed.\n   * @platform ios\n   */\n  static get dismissedAction(): string {\n    return 'dismissedAction';\n  }\n}\n\nexport default Share;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StatusBar/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nconst emptyFunction = () => {};\n\nfunction StatusBar(): null {\n  return null;\n}\n\nStatusBar.setBackgroundColor = emptyFunction;\nStatusBar.setBarStyle = emptyFunction;\nStatusBar.setHidden = emptyFunction;\nStatusBar.setNetworkActivityIndicatorVisible = emptyFunction;\nStatusBar.setTranslucent = emptyFunction;\n\nexport default StatusBar;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/__tests__/compiler-createReactDOMStyle-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport createReactDOMStyle from '../compiler/createReactDOMStyle';\n\nconst reactNativeStyle = {\n  boxShadow: '1px 1px 1px 1px #000',\n  borderWidthLeft: 2,\n  borderWidth: 1,\n  borderWidthRight: 3,\n  display: 'flex',\n  marginVertical: 0,\n  opacity: 0,\n  shadowColor: 'red',\n  shadowOffset: { width: 1, height: 2 },\n  resizeMode: 'contain'\n};\n\ndescribe('compiler/createReactDOMStyle', () => {\n  test('noop on DOM styles', () => {\n    const firstStyle = createReactDOMStyle(reactNativeStyle);\n    const secondStyle = createReactDOMStyle(firstStyle);\n    expect(firstStyle).toEqual(secondStyle);\n  });\n\n  test('shortform -> longform for inline styles', () => {\n    const style = {\n      borderStyle: 'solid',\n      boxSizing: 'border-box',\n      borderBottomColor: 'white',\n      borderBottomWidth: 1,\n      borderWidth: 0,\n      marginTop: 50,\n      marginBlock: 25,\n      margin: 10,\n      overflow: 'hidden',\n      overscrollBehavior: 'contain',\n      paddingLeft: 50,\n      paddingInline: 25,\n      padding: 10\n    };\n\n    expect(createReactDOMStyle(style, true)).toMatchInlineSnapshot(`\n      {\n        \"borderBottomColor\": \"rgba(255,255,255,1.00)\",\n        \"borderBottomStyle\": \"solid\",\n        \"borderBottomWidth\": \"1px\",\n        \"borderLeftStyle\": \"solid\",\n        \"borderLeftWidth\": \"0px\",\n        \"borderRightStyle\": \"solid\",\n        \"borderRightWidth\": \"0px\",\n        \"borderTopStyle\": \"solid\",\n        \"borderTopWidth\": \"0px\",\n        \"boxSizing\": \"border-box\",\n        \"marginBottom\": \"25px\",\n        \"marginLeft\": \"10px\",\n        \"marginRight\": \"10px\",\n        \"marginTop\": \"50px\",\n        \"overflowX\": \"hidden\",\n        \"overflowY\": \"hidden\",\n        \"overscrollBehaviorX\": \"contain\",\n        \"overscrollBehaviorY\": \"contain\",\n        \"paddingBottom\": \"10px\",\n        \"paddingLeft\": \"50px\",\n        \"paddingRight\": \"25px\",\n        \"paddingTop\": \"10px\",\n      }\n    `);\n  });\n\n  describe('flexbox styles', () => {\n    test('flex: -1', () => {\n      expect(createReactDOMStyle({ flex: -1 })).toEqual({\n        flexGrow: 0,\n        flexShrink: 1,\n        flexBasis: 'auto'\n      });\n    });\n\n    test('flex: 0', () => {\n      expect(createReactDOMStyle({ flex: 0 })).toEqual({\n        flex: 0\n      });\n    });\n\n    test('flex: 1', () => {\n      expect(createReactDOMStyle({ flex: 1 })).toEqual({\n        flex: 1\n      });\n    });\n\n    test('flex: 10', () => {\n      expect(createReactDOMStyle({ flex: 10 })).toEqual({\n        flex: 10\n      });\n    });\n\n    test('flexBasis overrides', () => {\n      // is flex-basis applied?\n      expect(createReactDOMStyle({ flexBasis: '25%' })).toEqual({\n        flexBasis: '25%'\n      });\n\n      // can flex-basis override the 'flex' expansion?\n      expect(createReactDOMStyle({ flex: 1, flexBasis: '25%' })).toEqual({\n        flex: 1,\n        flexBasis: '25%'\n      });\n    });\n\n    test('flexShrink overrides', () => {\n      // is flex-shrink applied?\n      expect(createReactDOMStyle({ flexShrink: 1 })).toEqual({\n        flexShrink: 1\n      });\n\n      // can flex-shrink override the 'flex' expansion?\n      expect(createReactDOMStyle({ flex: 1, flexShrink: 2 })).toEqual({\n        flex: 1,\n        flexShrink: 2\n      });\n    });\n  });\n\n  describe('fontFamily', () => {\n    test('general case', () => {\n      expect(createReactDOMStyle({ fontFamily: 'Georgia, Times, serif' }))\n        .toMatchInlineSnapshot(`\n        {\n          \"fontFamily\": \"Georgia, Times, serif\",\n        }\n      `);\n    });\n\n    test('\"monospace\"', () => {\n      expect(createReactDOMStyle({ fontFamily: 'monospace' }))\n        .toMatchInlineSnapshot(`\n        {\n          \"fontFamily\": \"monospace,monospace\",\n        }\n      `);\n    });\n\n    test('\"System\"', () => {\n      expect(createReactDOMStyle({ fontFamily: 'System' }))\n        .toMatchInlineSnapshot(`\n        {\n          \"fontFamily\": \"-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif\",\n        }\n      `);\n      expect(createReactDOMStyle({ font: '14px System' }))\n        .toMatchInlineSnapshot(`\n        {\n          \"font\": \"14px -apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif\",\n        }\n      `);\n    });\n\n    test('\"Noto, System\"', () => {\n      expect(createReactDOMStyle({ fontFamily: 'Noto, System' }))\n        .toMatchInlineSnapshot(`\n        {\n          \"fontFamily\": \"Noto,-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif\",\n        }\n      `);\n      expect(createReactDOMStyle({ font: '14px Noto, System' }))\n        .toMatchInlineSnapshot(`\n        {\n          \"font\": \"14px Noto, -apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif\",\n        }\n      `);\n    });\n\n    test('\"Noto, BlinkMacSystemFont\"', () => {\n      expect(createReactDOMStyle({ fontFamily: 'Noto, BlinkMacSystemFont' }))\n        .toMatchInlineSnapshot(`\n        {\n          \"fontFamily\": \"Noto,BlinkMacSystemFont\",\n        }\n      `);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/__tests__/compiler-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport { atomic, classic, inline } from '../compiler';\n\ndescribe('StyleSheet/compile', () => {\n  describe('atomic', () => {\n    test('converts style to atomic CSS', () => {\n      const result = atomic({\n        animationDirection: 'alternate,alternate-reverse',\n        animationKeyframes: [\n          { '0%': { top: 0 }, '50%': { top: 5 }, '100%': { top: 10 } },\n          { from: { left: 0 }, to: { left: 10 } }\n        ],\n        fontFamily: 'System',\n        insetInlineStart: '12.34%',\n        marginBlockEnd: 5,\n        marginInline: 10,\n        marginInlineEnd: 2,\n        marginInlineStart: 1,\n        placeholderTextColor: 'gray',\n        scrollbarWidth: 'none',\n        pointerEvents: 'box-only',\n        textAlign: 'start',\n        transform: 'translateX(50px) scale(-1)'\n      });\n\n      expect(result).toMatchInlineSnapshot(`\n        [\n          {\n            \"$$css\": true,\n            \"$$css$localize\": true,\n            \"animationDirection\": \"r-animationDirection-1wgwto7\",\n            \"animationKeyframes\": \"r-animationKeyframes-zacbmr\",\n            \"fontFamily\": \"r-fontFamily-1qd0xha\",\n            \"insetInlineStart\": [\n              \"r-insetInlineStart-1xn1m1p\",\n              \"r-insetInlineStart-1y2vi53\",\n            ],\n            \"marginBlockEnd\": \"r-marginBlockEnd-1xf1q1v\",\n            \"marginInline\": \"r-marginInline-lcslpx\",\n            \"marginInlineEnd\": [\n              \"r-marginInlineEnd-n2wkgt\",\n              \"r-marginInlineEnd-r7lizz\",\n            ],\n            \"marginInlineStart\": [\n              \"r-marginInlineStart-hjq6k0\",\n              \"r-marginInlineStart-1iwt575\",\n            ],\n            \"placeholderTextColor\": \"r-placeholderTextColor-1418aci\",\n            \"pointerEvents\": \"r-pointerEvents-ah5dr5\",\n            \"scrollbarWidth\": \"r-scrollbarWidth-2eszeu\",\n            \"textAlign\": [\n              \"r-textAlign-fdjqy7\",\n              \"r-textAlign-1ff274t\",\n            ],\n            \"transform\": \"r-transform-d7xd9i\",\n          },\n          [\n            [\n              [\n                \".r-animationDirection-1wgwto7{animation-direction:alternate,alternate-reverse;}\",\n              ],\n              3,\n            ],\n            [\n              [\n                \".r-animationKeyframes-zacbmr{animation-name:r-animation-8jhqzh,r-animation-5azpl5;}\",\n                \"@-webkit-keyframes r-animation-8jhqzh{0%{top:0px;}50%{top:5px;}100%{top:10px;}}\",\n                \"@keyframes r-animation-8jhqzh{0%{top:0px;}50%{top:5px;}100%{top:10px;}}\",\n                \"@-webkit-keyframes r-animation-5azpl5{from{left:0px;}to{left:10px;}}\",\n                \"@keyframes r-animation-5azpl5{from{left:0px;}to{left:10px;}}\",\n              ],\n              3,\n            ],\n            [\n              [\n                \".r-fontFamily-1qd0xha{font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;}\",\n              ],\n              3,\n            ],\n            [\n              [\n                \".r-insetInlineStart-1xn1m1p{left:12.34%;}\",\n              ],\n              2.2,\n            ],\n            [\n              [\n                \".r-insetInlineStart-1y2vi53{right:12.34%;}\",\n              ],\n              2.2,\n            ],\n            [\n              [\n                \".r-marginBlockEnd-1xf1q1v{margin-bottom:5px;}\",\n              ],\n              2.2,\n            ],\n            [\n              [\n                \".r-marginInline-lcslpx{margin-left:10px;margin-right:10px;}\",\n              ],\n              2.1,\n            ],\n            [\n              [\n                \".r-marginInlineEnd-n2wkgt{margin-right:2px;}\",\n              ],\n              2.2,\n            ],\n            [\n              [\n                \".r-marginInlineEnd-r7lizz{margin-left:2px;}\",\n              ],\n              2.2,\n            ],\n            [\n              [\n                \".r-marginInlineStart-hjq6k0{margin-left:1px;}\",\n              ],\n              2.2,\n            ],\n            [\n              [\n                \".r-marginInlineStart-1iwt575{margin-right:1px;}\",\n              ],\n              2.2,\n            ],\n            [\n              [\n                \".r-placeholderTextColor-1418aci::-webkit-input-placeholder{color:rgba(128,128,128,1.00);opacity:1;}\",\n                \".r-placeholderTextColor-1418aci::-moz-placeholder{color:rgba(128,128,128,1.00);opacity:1;}\",\n                \".r-placeholderTextColor-1418aci:-ms-input-placeholder{color:rgba(128,128,128,1.00);opacity:1;}\",\n                \".r-placeholderTextColor-1418aci::placeholder{color:rgba(128,128,128,1.00);opacity:1;}\",\n              ],\n              3,\n            ],\n            [\n              [\n                \".r-pointerEvents-ah5dr5>* {pointer-events:none;}\",\n                \".r-pointerEvents-ah5dr5{pointer-events:auto!important;}\",\n              ],\n              3,\n            ],\n            [\n              [\n                \".r-scrollbarWidth-2eszeu::-webkit-scrollbar{display:none}\",\n                \".r-scrollbarWidth-2eszeu{scrollbar-width:none;}\",\n              ],\n              3,\n            ],\n            [\n              [\n                \".r-textAlign-fdjqy7{text-align:left;}\",\n              ],\n              3,\n            ],\n            [\n              [\n                \".r-textAlign-1ff274t{text-align:right;}\",\n              ],\n              3,\n            ],\n            [\n              [\n                \".r-transform-d7xd9i{transform:translateX(50px) scale(-1);}\",\n              ],\n              3,\n            ],\n          ],\n        ]\n      `);\n    });\n\n    test('when parent is pointer-events=none, pointer-events=none applied to children', () => {\n      const result = atomic({\n        pointerEvents: 'none'\n      });\n\n      expect(result).toMatchInlineSnapshot(`\n        [\n          {\n            \"$$css\": true,\n            \"pointerEvents\": \"r-pointerEvents-633pao\",\n          },\n          [\n            [\n              [\n                \".r-pointerEvents-633pao>* {pointer-events:none;}\",\n                \".r-pointerEvents-633pao{pointer-events:none!important;}\",\n              ],\n              3,\n            ],\n          ],\n        ]\n      `);\n    });\n\n    test('when parent is pointer-events=box-none, pointer-events=auto applied to children', () => {\n      const result = atomic({\n        pointerEvents: 'box-none'\n      });\n\n      expect(result).toMatchInlineSnapshot(`\n        [\n          {\n            \"$$css\": true,\n            \"pointerEvents\": \"r-pointerEvents-12vffkv\",\n          },\n          [\n            [\n              [\n                \".r-pointerEvents-12vffkv>* {pointer-events:auto;}\",\n                \".r-pointerEvents-12vffkv{pointer-events:none!important;}\",\n              ],\n              3,\n            ],\n          ],\n        ]\n      `);\n    });\n  });\n\n  describe('classic', () => {\n    test('converts style to classic CSS', () => {\n      const result = classic(\n        {\n          animationDirection: 'alternate,alternate-reverse',\n          animationKeyframes: [\n            { '0%': { top: 0 }, '50%': { top: 5 }, '100%': { top: 10 } },\n            { from: { left: 0 }, to: { left: 10 } }\n          ],\n          marginInline: 10,\n          font: '14px System',\n          transform: 'translateX(50px) scale(-1)'\n        },\n        'test'\n      );\n      expect(result).toMatchInlineSnapshot(`\n        [\n          {\n            \"$$css\": true,\n            \"css-test-tbk4su\": \"css-test-tbk4su\",\n          },\n          [\n            [\n              [\n                \"@-webkit-keyframes r-animation-8jhqzh{0%{top:0px;}50%{top:5px;}100%{top:10px;}}\",\n                \"@keyframes r-animation-8jhqzh{0%{top:0px;}50%{top:5px;}100%{top:10px;}}\",\n                \"@-webkit-keyframes r-animation-5azpl5{from{left:0px;}to{left:10px;}}\",\n                \"@keyframes r-animation-5azpl5{from{left:0px;}to{left:10px;}}\",\n                \".css-test-tbk4su{animation-direction:alternate,alternate-reverse;animation-name:r-animation-8jhqzh,r-animation-5azpl5;font:14px -apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif;margin-left:10px;margin-right:10px;transform:translateX(50px) scale(-1);}\",\n              ],\n              1,\n            ],\n          ],\n        ]\n      `);\n    });\n  });\n\n  describe('inline', () => {\n    test('converts style to inline styles', () => {\n      const result = inline({\n        marginBlockEnd: 5,\n        marginInline: 10,\n        display: 'flex',\n        flexShrink: 1\n      });\n\n      expect(result).toMatchInlineSnapshot(`\n        {\n          \"display\": \"flex\",\n          \"flexShrink\": 1,\n          \"marginBottom\": \"5px\",\n          \"marginLeft\": \"10px\",\n          \"marginRight\": \"10px\",\n        }\n      `);\n    });\n\n    describe('logical style polyfill', () => {\n      [false, true].forEach((isRTL) => {\n        const dir = isRTL ? 'rtl' : 'ltr';\n\n        test(`ignores \"left\" properties for ${dir}`, () => {\n          const initial = {\n            borderLeftColor: 'rgba(255,0,0,1.00)',\n            borderLeftStyle: 'solid',\n            borderLeftWidth: '1px',\n            left: '1px',\n            marginLeft: '5px',\n            paddingLeft: '10px'\n          };\n          expect(inline(initial, isRTL)).toEqual(initial);\n        });\n\n        test(`ignores \"right\" properties for ${dir}`, () => {\n          const initial = {\n            borderRightColor: 'rgba(255,0,0,1.00)',\n            borderRightStyle: 'solid',\n            borderRightWidth: '1px',\n            right: '1px',\n            marginRight: '5px',\n            paddingRight: '10px'\n          };\n          expect(inline(initial, isRTL)).toEqual(initial);\n        });\n\n        test(`ignores \"left\" values for ${dir}`, () => {\n          const initial = {\n            clear: 'left',\n            float: 'left',\n            textAlign: 'left',\n            transitionProperty: 'left'\n          };\n          expect(inline(initial, isRTL)).toEqual(initial);\n        });\n\n        test(`ignores \"right\" values for ${dir}`, () => {\n          const initial = {\n            clear: 'right',\n            float: 'right',\n            textAlign: 'right',\n            transitionProperty: 'right'\n          };\n          expect(inline(initial, isRTL)).toEqual(initial);\n        });\n\n        test(`converts \"start\" properties for ${dir}`, () => {\n          const initial = {\n            borderInlineStartColor: 'red',\n            borderInlineStartStyle: 'solid',\n            borderInlineStartWidth: 1,\n            insetInlineStart: 1,\n            marginBlockStart: 5,\n            marginInlineStart: 5,\n            paddingInlineStart: 10\n          };\n\n          const expectedLTR = {\n            borderLeftColor: 'rgba(255,0,0,1.00)',\n            borderLeftStyle: 'solid',\n            borderLeftWidth: '1px',\n            left: '1px',\n            marginLeft: '5px',\n            marginTop: '5px',\n            paddingLeft: '10px'\n          };\n          const expectedRTL = {\n            borderRightColor: 'rgba(255,0,0,1.00)',\n            borderRightStyle: 'solid',\n            borderRightWidth: '1px',\n            right: '1px',\n            marginRight: '5px',\n            marginTop: '5px',\n            paddingRight: '10px'\n          };\n          expect(inline(initial, isRTL)).toEqual(\n            isRTL ? expectedRTL : expectedLTR\n          );\n        });\n\n        test(`converts \"end\" properties for ${dir}`, () => {\n          const initial = {\n            borderInlineEndColor: 'red',\n            borderInlineEndStyle: 'solid',\n            borderInlineEndWidth: 1,\n            insetInlineEnd: 1,\n            marginBlockEnd: 5,\n            marginInlineEnd: 5,\n            paddingInlineEnd: 10\n          };\n\n          const expectedLTR = {\n            borderRightColor: 'rgba(255,0,0,1.00)',\n            borderRightStyle: 'solid',\n            borderRightWidth: '1px',\n            right: '1px',\n            marginBottom: '5px',\n            marginRight: '5px',\n            paddingRight: '10px'\n          };\n          const expectedRTL = {\n            borderLeftColor: 'rgba(255,0,0,1.00)',\n            borderLeftStyle: 'solid',\n            borderLeftWidth: '1px',\n            left: '1px',\n            marginBottom: '5px',\n            marginLeft: '5px',\n            paddingLeft: '10px'\n          };\n          expect(inline(initial, isRTL)).toEqual(\n            isRTL ? expectedRTL : expectedLTR\n          );\n        });\n\n        test(`converts \"start\" values for ${dir}`, () => {\n          const initial = {\n            clear: 'start',\n            float: 'start',\n            textAlign: 'start',\n            transitionProperty: 'insetInlineStart'\n          };\n\n          const expectedLTR = {\n            clear: 'left',\n            float: 'left',\n            textAlign: 'left',\n            transitionProperty: 'left'\n          };\n          const expectedRTL = {\n            clear: 'right',\n            float: 'right',\n            textAlign: 'right',\n            transitionProperty: 'right'\n          };\n          expect(inline(initial, isRTL)).toEqual(\n            isRTL ? expectedRTL : expectedLTR\n          );\n        });\n\n        test(`converts \"end\" values for ${dir}`, () => {\n          const initial = {\n            clear: 'end',\n            float: 'end',\n            textAlign: 'end',\n            transitionProperty: 'insetInlineEnd'\n          };\n\n          const expectedLTR = {\n            clear: 'right',\n            float: 'right',\n            textAlign: 'right',\n            transitionProperty: 'right'\n          };\n          const expectedRTL = {\n            clear: 'left',\n            float: 'left',\n            textAlign: 'left',\n            transitionProperty: 'left'\n          };\n          expect(inline(initial, isRTL)).toEqual(\n            isRTL ? expectedRTL : expectedLTR\n          );\n        });\n\n        test('physical properties take precedence over logical properties', () => {\n          const initialLTR = {\n            borderInlineStartWidth: 10,\n            borderLeftWidth: 0,\n            insetInlineEnd: 10,\n            right: 0,\n            insetBlockStart: 5,\n            top: 0,\n            marginInlineStart: 10,\n            marginLeft: 0\n          };\n          const expectedLTR = {\n            borderLeftWidth: '0px',\n            marginLeft: '0px',\n            right: '0px',\n            top: '0px'\n          };\n\n          const initialRTL = {\n            borderInlineStartWidth: 10,\n            borderRightWidth: 0,\n            insetInlineEnd: 10,\n            left: 0,\n            insetBlockStart: 5,\n            top: 0,\n            marginInlineStart: 10,\n            marginRight: 0\n          };\n          const expectedRTL = {\n            borderRightWidth: '0px',\n            marginRight: '0px',\n            left: '0px',\n            top: '0px'\n          };\n          expect(inline(isRTL ? initialRTL : initialLTR, isRTL)).toEqual(\n            isRTL ? expectedRTL : expectedLTR\n          );\n        });\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/__tests__/dom-createOrderedCSSStyleSheet-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport createOrderedCSSStyleSheet from '../dom/createOrderedCSSStyleSheet';\n\nconst insertStyleElement = () => {\n  const element = document.createElement('style');\n  const head = document.head;\n  head.insertBefore(element, head.firstChild);\n  return element;\n};\n\nconst removeStyleElement = (element) => {\n  document.head.removeChild(element);\n};\n\ndescribe('createOrderedCSSStyleSheet', () => {\n  describe('#insert', () => {\n    test('insertion order for same group', () => {\n      const sheet = createOrderedCSSStyleSheet();\n\n      expect(sheet.getTextContent()).toMatchInlineSnapshot('\"\"');\n\n      sheet.insert('.a {}', 0);\n      expect(sheet.getTextContent()).toMatchInlineSnapshot(`\n        \"[stylesheet-group=\"0\"]{}\n        .a {}\"\n      `);\n\n      sheet.insert('.b {}', 0);\n      expect(sheet.getTextContent()).toMatchInlineSnapshot(`\n        \"[stylesheet-group=\"0\"]{}\n        .a {}\n        .b {}\"\n      `);\n\n      sheet.insert('.c {}', 0);\n      expect(sheet.getTextContent()).toMatchInlineSnapshot(`\n        \"[stylesheet-group=\"0\"]{}\n        .a {}\n        .b {}\n        .c {}\"\n      `);\n    });\n\n    test('deduplication for same group', () => {\n      const sheet = createOrderedCSSStyleSheet();\n\n      sheet.insert('.a {}', 0);\n      sheet.insert('.a {}', 0);\n      sheet.insert('.a {}', 0);\n\n      expect(sheet.getTextContent()).toMatchInlineSnapshot(`\n        \"[stylesheet-group=\"0\"]{}\n        .a {}\"\n      `);\n    });\n\n    test('order for same group', () => {\n      const sheet = createOrderedCSSStyleSheet();\n\n      sheet.insert('.c {}', 0);\n      sheet.insert('.b {}', 0);\n      sheet.insert('.a {}', 0);\n\n      expect(sheet.getTextContent()).toMatchInlineSnapshot(`\n        \"[stylesheet-group=\"0\"]{}\n        .a {}\n        .b {}\n        .c {}\"\n      `);\n    });\n\n    test('insertion order for different groups', () => {\n      const sheet = createOrderedCSSStyleSheet();\n\n      sheet.insert('.nine-1 {}', 9.9);\n      sheet.insert('.nine-2 {}', 9.9);\n      sheet.insert('.three {}', 3);\n      sheet.insert('.one {}', 1);\n      sheet.insert('.two {}', 2.2);\n      sheet.insert('.four-1 {}', 4);\n      sheet.insert('.four-2 {}', 4);\n      sheet.insert('.twenty {}', 20);\n      sheet.insert('.ten {}', 10);\n      sheet.insert('.twenty-point2 {}', 20.2);\n\n      expect(sheet.getTextContent()).toMatchInlineSnapshot(`\n        \"[stylesheet-group=\"1\"]{}\n        .one {}\n        [stylesheet-group=\"2.2\"]{}\n        .two {}\n        [stylesheet-group=\"3\"]{}\n        .three {}\n        [stylesheet-group=\"4\"]{}\n        .four-1 {}\n        .four-2 {}\n        [stylesheet-group=\"9.9\"]{}\n        .nine-1 {}\n        .nine-2 {}\n        [stylesheet-group=\"10\"]{}\n        .ten {}\n        [stylesheet-group=\"20\"]{}\n        .twenty {}\n        [stylesheet-group=\"20.2\"]{}\n        .twenty-point2 {}\"\n      `);\n    });\n  });\n\n  describe('client-side hydration', () => {\n    let element;\n\n    beforeEach(() => {\n      if (element != null) {\n        removeStyleElement(element);\n      }\n      element = insertStyleElement();\n    });\n\n    test('from SSR CSS', () => {\n      // Setup SSR CSS\n      const serverSheet = createOrderedCSSStyleSheet();\n      serverSheet.insert('.one { width: 10px; }', 1);\n      serverSheet.insert('.two-1 { height: 20px; }', 2);\n      serverSheet.insert('.two-2 { color: red; }', 2);\n      serverSheet.insert('@keyframes anim { 0% { opacity: 1; } }', 2);\n      const textContent = serverSheet.getTextContent();\n\n      // Add SSR CSS to client style sheet\n      element.appendChild(document.createTextNode(textContent));\n      const clientSheet = createOrderedCSSStyleSheet(element.sheet);\n      expect(clientSheet.getTextContent()).toMatchInlineSnapshot(`\n        \"[stylesheet-group=\"1\"] {}\n        .one {width: 10px;}\n        [stylesheet-group=\"2\"] {}\n        .two-1 {height: 20px;}\n        .two-2 {color: red;}\n        @keyframes anim { \n          0% {opacity: 1;} \n        }\"\n      `);\n    });\n\n    test('works when the group marker is in single quotes', () => {\n      // Setup SSR CSS\n      const serverSheet = createOrderedCSSStyleSheet();\n      serverSheet.insert('.a { color: red }', 0);\n      serverSheet.insert('.b { color: red }', 1);\n      const textContent = serverSheet.getTextContent().replace(/\"/g, \"'\");\n\n      // Add SSR CSS to client style sheet\n      element.appendChild(document.createTextNode(textContent));\n      const clientSheet = createOrderedCSSStyleSheet(element.sheet);\n      clientSheet.insert('.c { color: red }', 0);\n      expect(clientSheet.getTextContent()).toMatchInlineSnapshot(`\n        \"[stylesheet-group='0'] {}\n        .a {color: red;}\n        .c { color: red }\n        [stylesheet-group='1'] {}\n        .b {color: red;}\"\n      `);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/__tests__/dom-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport { createSheet } from '../dom';\n\ndescribe('createSheet', () => {\n  test('creates a sheet on the client', () => {\n    const sheet = createSheet();\n    expect(sheet.id).toMatchInlineSnapshot(`\"react-native-stylesheet\"`);\n    expect(typeof sheet.getTextContent()).toBe('string');\n    expect(typeof sheet.insert).toBe('function');\n  });\n\n  test('supports multiple documents with same styles', () => {\n    const sheet = createSheet();\n    sheet.insert('.test-sheet { opacity: 1 }', 3);\n\n    // Iframe -----\n    const iframe = document.createElement('iframe');\n    document.body.appendChild(iframe);\n    const iframeDoc = iframe.contentWindow.document;\n    const iframeRootTag = document.createElement('div');\n    iframeDoc.body.appendChild(iframeRootTag);\n    const iframeSheet = createSheet(iframeRootTag);\n\n    // Did we generate a new sheet?\n    expect(sheet).not.toBe(iframeSheet);\n    expect(iframeSheet.id).toMatchInlineSnapshot(`\"react-native-stylesheet\"`);\n    expect(typeof iframeSheet.insert).toBe('function');\n    expect(iframeDoc.getElementById('react-native-stylesheet')).not.toBe(null);\n    // Does the content match existing sheets?\n    expect(iframeSheet.getTextContent().includes('test-sheet')).toBe(true);\n    // Does the content update when other sheets are updated?\n    sheet.insert('.test-iframe { opacity: 0 }', 3);\n    expect(iframeSheet.getTextContent().includes('test-iframe')).toBe(true);\n\n    // ShadowDOM -----\n    const div = document.createElement('div');\n    const shadowRoot = div.attachShadow({ mode: 'open' });\n    const shadowRootTag = document.createElement('div');\n    shadowRoot.appendChild(shadowRootTag);\n    document.body.appendChild(shadowRoot);\n    const shadowSheet = createSheet(shadowRootTag);\n\n    // Did we generate a new sheet?\n    expect(sheet).not.toBe(shadowSheet);\n    expect(shadowSheet.id).toMatchInlineSnapshot(`\"react-native-stylesheet\"`);\n    expect(typeof shadowSheet.insert).toBe('function');\n    // expect(shadowRoot.getElementById('react-native-stylesheet')).not.toBe(null);\n    // Does the content match existing sheets?\n    expect(shadowSheet.getTextContent().includes('test-sheet')).toBe(true);\n    // Does the content update when other sheets are updated?\n    sheet.insert('.test-shadow { opacity: 0 }', 3);\n    expect(shadowSheet.getTextContent().includes('test-shadow')).toBe(true);\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/__tests__/dom-test.node.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport { createSheet } from '../dom';\n\ndescribe('createSheet', () => {\n  test('creates a sheet on the server', () => {\n    const sheet = createSheet();\n    expect(typeof sheet.insert).toBe('function');\n    expect(sheet.id).toMatchInlineSnapshot(`\"react-native-stylesheet\"`);\n    expect(sheet.getTextContent()).toMatchInlineSnapshot(`\n      \"[stylesheet-group=\"0\"]{}\n      body{margin:0;}\n      button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}\n      html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}\n      input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}\"\n    `);\n\n    sheet.insert('.test { opacity: 0 }', 1);\n    expect(sheet.getTextContent()).toMatchInlineSnapshot(`\n      \"[stylesheet-group=\"0\"]{}\n      body{margin:0;}\n      button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}\n      html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}\n      input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}\n      [stylesheet-group=\"1\"]{}\n      .test { opacity: 0 }\"\n    `);\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport StyleSheet from '../index';\n\ndescribe('StyleSheet', () => {\n  // test this first because subsequent 'create' calls will change the snapshot\n  test('getSheet', () => {\n    expect(StyleSheet.getSheet()).toMatchInlineSnapshot(`\n      {\n        \"id\": \"react-native-stylesheet\",\n        \"textContent\": \"[stylesheet-group=\"0\"]{}\n      body{margin:0;}\n      button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}\n      html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}\n      input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}\n      [stylesheet-group=\"3\"]{}\n      .r-bottom-1p0dtai{bottom:0px;}\n      .r-left-1d2f490{left:0px;}\n      .r-position-u8s1d{position:absolute;}\n      .r-right-zchlnj{right:0px;}\n      .r-top-ipm5af{top:0px;}\",\n      }\n    `);\n  });\n\n  test('absoluteFill', () => {\n    expect(StyleSheet.absoluteFill).toMatchInlineSnapshot(`\n      {\n        \"bottom\": 0,\n        \"left\": 0,\n        \"position\": \"absolute\",\n        \"right\": 0,\n        \"top\": 0,\n      }\n    `);\n  });\n\n  test('absoluteFillObject', () => {\n    expect(StyleSheet.absoluteFillObject).toMatchInlineSnapshot(`\n      {\n        \"bottom\": 0,\n        \"left\": 0,\n        \"position\": \"absolute\",\n        \"right\": 0,\n        \"top\": 0,\n      }\n    `);\n  });\n\n  describe('create', () => {\n    test('returns original style objects', () => {\n      const style = StyleSheet.create({ root: { position: 'absolute' } });\n      expect(style.root).toMatchInlineSnapshot(`\n        {\n          \"position\": \"absolute\",\n        }\n      `);\n    });\n\n    test('e2e resolves to classname', () => {\n      const style = StyleSheet.create({ root: { position: 'absolute' } });\n      expect(StyleSheet(style.root)).toMatchInlineSnapshot(`\n        [\n          \"r-position-u8s1d\",\n          null,\n        ]\n      `);\n    });\n\n    test('e2e flattens shadow style properties', () => {\n      const style = StyleSheet.create({\n        root: {\n          shadowColor: 'rgba(50,60,70,0.5)',\n          shadowOffset: { width: 1, height: 2 },\n          shadowOpacity: 0.5,\n          shadowRadius: 3,\n          textShadowColor: 'rgba(50,60,70,0.50)',\n          textShadowOffset: { width: 5, height: 10 },\n          textShadowRadius: 15\n        }\n      });\n      expect(StyleSheet(style.root)).toMatchInlineSnapshot(`\n        [\n          \"r-boxShadow-o3ayyy r-textShadow-1x2q051\",\n          null,\n        ]\n      `);\n    });\n  });\n\n  describe('flatten', () => {\n    test('should merge style objects', () => {\n      const style = StyleSheet.flatten([{ opacity: 1 }, { order: 2 }]);\n      expect(style).toMatchInlineSnapshot(`\n        {\n          \"opacity\": 1,\n          \"order\": 2,\n        }\n      `);\n    });\n\n    test('should override style properties', () => {\n      const style = StyleSheet.flatten([\n        { backgroundColor: '#000', order: 1 },\n        { backgroundColor: '#023c69', order: null }\n      ]);\n      expect(style).toMatchInlineSnapshot(`\n        {\n          \"backgroundColor\": \"#023c69\",\n          \"order\": null,\n        }\n      `);\n    });\n\n    test('should overwrite properties with `undefined`', () => {\n      const style = StyleSheet.flatten([\n        { backgroundColor: '#000' },\n        { backgroundColor: undefined }\n      ]);\n      expect(style).toMatchInlineSnapshot(`\n        {\n          \"backgroundColor\": undefined,\n        }\n      `);\n    });\n\n    test('should not fail on falsy values', () => {\n      expect(() => StyleSheet.flatten([null, false, undefined])).not.toThrow();\n    });\n\n    test('should recursively flatten arrays', () => {\n      const style = StyleSheet.flatten([\n        null,\n        [],\n        [{ order: 2 }, { opacity: 1 }],\n        { order: 3 }\n      ]);\n      expect(style).toMatchInlineSnapshot(`\n        {\n          \"opacity\": 1,\n          \"order\": 3,\n        }\n      `);\n    });\n  });\n\n  test('hairlineWidth', () => {\n    expect(Number.isInteger(StyleSheet.hairlineWidth) === true).toBeTruthy();\n  });\n\n  describe('resolve', () => {\n    test('empty', () => {\n      expect(StyleSheet()).toMatchInlineSnapshot(`\n        [\n          \"\",\n          null,\n        ]\n      `);\n      expect(StyleSheet({})).toMatchInlineSnapshot(`\n        [\n          \"\",\n          null,\n        ]\n      `);\n      expect(StyleSheet([])).toMatchInlineSnapshot(`\n        [\n          \"\",\n          null,\n        ]\n      `);\n    });\n\n    test('transforms compiled object to className', () => {\n      expect(\n        StyleSheet([\n          {\n            $$css: true,\n            position: 'position-absolute',\n            opacity: 'opacity-05',\n            width: 'width-200'\n          }\n        ])\n      ).toMatchInlineSnapshot(`\n        [\n          \"position-absolute opacity-05 width-200\",\n          null,\n        ]\n      `);\n    });\n\n    test('transforms array of compiled objects to className', () => {\n      expect(\n        StyleSheet([\n          {\n            $$css: true,\n            borderWidth: 'borderWidth-0',\n            borderColor: 'borderColor-red',\n            display: 'display-flex',\n            width: 'width-100'\n          },\n          {\n            $$css: true,\n            position: 'position-absolute',\n            opacity: 'opacity-05'\n          },\n          [\n            {\n              $$css: true,\n              width: 'width-200'\n            }\n          ]\n        ])\n      ).toMatchInlineSnapshot(`\n        [\n          \"borderWidth-0 borderColor-red display-flex position-absolute opacity-05 width-200\",\n          null,\n        ]\n      `);\n    });\n\n    test('dedupes class names and inline styles', () => {\n      const styleACompiled = {\n        $$css: true,\n        backgroundColor: 'backgroundColor-red',\n        display: 'display-block'\n      };\n      const styleBCompiled = {\n        $$css: true,\n        backgroundColor: 'backgroundColor-green',\n        color: 'color-green'\n      };\n      const styleBInline = {\n        backgroundColor: 'rgba(0,0,255,1.00)',\n        color: null\n      };\n\n      const [className1, inlineStyle1] = StyleSheet([\n        styleACompiled,\n        styleBCompiled,\n        styleBInline\n      ]);\n      expect(className1).toBe('display-block');\n      expect(inlineStyle1).toEqual({ backgroundColor: 'rgba(0,0,255,1.00)' });\n\n      const [className2, inlineStyle2] = StyleSheet([\n        styleACompiled,\n        styleBInline,\n        styleBCompiled\n      ]);\n      expect(className2).toBe(\n        'display-block backgroundColor-green color-green'\n      );\n      expect(inlineStyle2).toEqual(null);\n    });\n\n    test('long form inline style properties take precedence over static shorthand properties', () => {\n      const styles1 = StyleSheet.create({\n        test: { paddingHorizontal: '40px' }\n      });\n      const inlineStyle1 = { padding: '8px', paddingHorizontal: '40px' };\n      expect(StyleSheet([styles1.test, inlineStyle1])).toMatchInlineSnapshot(`\n        [\n          \"\",\n          {\n            \"paddingBottom\": \"8px\",\n            \"paddingLeft\": \"40px\",\n            \"paddingRight\": \"40px\",\n            \"paddingTop\": \"8px\",\n          },\n        ]\n      `);\n\n      const styles2 = StyleSheet.create({ test: { marginVertical: '40px' } });\n      const inlineStyle2 = { margin: '8px', marginVertical: '40px' };\n      expect(StyleSheet([styles2.test, inlineStyle2])).toMatchInlineSnapshot(`\n        [\n          \"\",\n          {\n            \"marginBottom\": \"40px\",\n            \"marginLeft\": \"8px\",\n            \"marginRight\": \"8px\",\n            \"marginTop\": \"40px\",\n          },\n        ]\n      `);\n    });\n\n    test('polyfills logical styles', () => {\n      const inlineA = { start: '12.34%' };\n      const inlineB = { textAlign: 'start' };\n      const inlineC = { marginEnd: 10 };\n\n      const a = StyleSheet.create({ x: { ...inlineA } }).x;\n      const b = StyleSheet.create({ x: { ...inlineB } }).x;\n      const c = StyleSheet.create({ x: { ...inlineC } }).x;\n      const writingDirection = 'rtl';\n\n      // inline styles\n      const inlineStyle = [inlineA, inlineB, inlineC];\n      expect(StyleSheet(inlineStyle)).toMatchInlineSnapshot(`\n        [\n          \"\",\n          {\n            \"left\": \"12.34%\",\n            \"marginRight\": \"10px\",\n            \"textAlign\": \"left\",\n          },\n        ]\n      `);\n      expect(StyleSheet(inlineStyle, { writingDirection }))\n        .toMatchInlineSnapshot(`\n        [\n          \"\",\n          {\n            \"marginLeft\": \"10px\",\n            \"right\": \"12.34%\",\n            \"textAlign\": \"right\",\n          },\n        ]\n      `);\n      expect(\n        StyleSheet(\n          [\n            inlineStyle,\n            { marginLeft: 1, marginEnd: 0, marginStart: 0, marginRight: 11 }\n          ],\n          { writingDirection }\n        )\n      ).toMatchInlineSnapshot(`\n        [\n          \"\",\n          {\n            \"marginLeft\": \"1px\",\n            \"marginRight\": \"11px\",\n            \"right\": \"12.34%\",\n            \"textAlign\": \"right\",\n          },\n        ]\n      `);\n      expect(\n        StyleSheet([inlineStyle, { marginEnd: null, marginLeft: 11 }], {\n          writingDirection\n        })\n      ).toMatchInlineSnapshot(`\n        [\n          \"\",\n          {\n            \"marginLeft\": \"11px\",\n            \"right\": \"12.34%\",\n            \"textAlign\": \"right\",\n          },\n        ]\n      `);\n\n      // static styles\n      const staticStyle = [a, b, c];\n      expect(StyleSheet(staticStyle)).toMatchInlineSnapshot(`\n        [\n          \"r-insetInlineStart-1xn1m1p r-textAlign-fdjqy7 r-marginInlineEnd-1l8l4mf\",\n          null,\n        ]\n      `);\n      expect(StyleSheet(staticStyle, { writingDirection }))\n        .toMatchInlineSnapshot(`\n        [\n          \"r-insetInlineStart-1y2vi53 r-textAlign-1ff274t r-marginInlineEnd-t1sew1\",\n          null,\n        ]\n      `);\n      const z = StyleSheet.create({ x: { marginRight: 33 } }).x;\n      expect(StyleSheet([staticStyle, z])).toMatchInlineSnapshot(`\n        [\n          \"r-insetInlineStart-1xn1m1p r-textAlign-fdjqy7 r-marginInlineEnd-1l8l4mf r-marginRight-j4vy6k\",\n          null,\n        ]\n      `);\n      expect(\n        StyleSheet(\n          [\n            staticStyle,\n            { marginLeft: 1, marginEnd: 0, marginStart: 0, marginRight: 11 }\n          ],\n\n          {\n            writingDirection\n          }\n        )\n      ).toMatchInlineSnapshot(`\n        [\n          \"r-insetInlineStart-1y2vi53 r-textAlign-1ff274t\",\n          {\n            \"marginLeft\": \"1px\",\n            \"marginRight\": \"11px\",\n          },\n        ]\n      `);\n      // logical can be nulled\n      expect(\n        StyleSheet([staticStyle, { marginEnd: null }], {\n          writingDirection\n        })\n      ).toMatchInlineSnapshot(`\n        [\n          \"r-insetInlineStart-1y2vi53 r-textAlign-1ff274t\",\n          null,\n        ]\n      `);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/__tests__/preprocess-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport { preprocess } from '../preprocess';\n\ndescribe('StyleSheet/preprocess', () => {\n  describe('non-standard styles', () => {\n    test('converts non-standard logical styles', () => {\n      expect(\n        preprocess({\n          end: 1,\n          marginEnd: 1,\n          marginHorizontal: 1,\n          marginStart: 1,\n          marginVertical: 1,\n          paddingEnd: 1,\n          paddingHorizontal: 1,\n          paddingStart: 1,\n          paddingVertical: 1,\n          start: 1\n        })\n      ).toEqual({\n        insetInlineEnd: 1,\n        insetInlineStart: 1,\n        marginBlock: 1,\n        marginInline: 1,\n        marginInlineEnd: 1,\n        marginInlineStart: 1,\n        paddingBlock: 1,\n        paddingInline: 1,\n        paddingInlineEnd: 1,\n        paddingInlineStart: 1\n      });\n    });\n\n    test('respects standard logical styles', () => {\n      expect(\n        preprocess({\n          end: 1,\n          marginEnd: 1,\n          marginHorizontal: 1,\n          marginStart: 1,\n          marginVertical: 1,\n          paddingEnd: 1,\n          paddingHorizontal: 1,\n          paddingStart: 1,\n          paddingVertical: 1,\n          start: 1,\n          // standard\n          insetInlineEnd: 2,\n          insetInlineStart: 2,\n          marginBlock: 2,\n          marginInline: 2,\n          marginInlineEnd: 2,\n          marginInlineStart: 2,\n          paddingBlock: 2,\n          paddingInline: 2,\n          paddingInlineEnd: 2,\n          paddingInlineStart: 2\n        })\n      ).toEqual({\n        insetInlineEnd: 2,\n        insetInlineStart: 2,\n        marginBlock: 2,\n        marginInline: 2,\n        marginInlineEnd: 2,\n        marginInlineStart: 2,\n        paddingBlock: 2,\n        paddingInline: 2,\n        paddingInlineEnd: 2,\n        paddingInlineStart: 2\n      });\n    });\n\n    test('converts non-standard textAlignVertical', () => {\n      expect(\n        preprocess({\n          textAlignVertical: 'center'\n        })\n      ).toEqual({\n        verticalAlign: 'middle'\n      });\n\n      expect(\n        preprocess({\n          verticalAlign: 'top',\n          textAlignVertical: 'center'\n        })\n      ).toEqual({\n        verticalAlign: 'top'\n      });\n    });\n\n    test('aspectRatio', () => {\n      expect(preprocess({ aspectRatio: 9 / 16 })).toEqual({\n        aspectRatio: '0.5625'\n      });\n\n      expect(preprocess({ aspectRatio: '0.5' })).toEqual({\n        aspectRatio: '0.5'\n      });\n\n      expect(preprocess({ aspectRatio: undefined })).toEqual({});\n    });\n\n    describe('boxShadow', () => {\n      // passthrough if boxShadow value is ever a string\n      test('string', () => {\n        const boxShadow = '0 1px 2px rgba(0, 0, 0, 0.5)';\n        const style = { boxShadow };\n        const resolved = preprocess(style);\n\n        expect(resolved).toEqual({ boxShadow });\n      });\n\n      test('array', () => {\n        const boxShadow = [\n          '0 1px 2px rgba(0, 0, 0, 0.5)',\n          {\n            offsetX: 1,\n            offsetY: 2,\n            blurRadius: 3\n          },\n          {\n            offsetX: 5,\n            offsetY: 6,\n            blurRadius: 7,\n            spreadDistance: 8,\n            color: 'rgba(0, 255, 0, 0.75)',\n            inset: true\n          }\n        ];\n        const style = { boxShadow };\n        const resolved = preprocess(style);\n\n        expect(resolved).toEqual({\n          boxShadow:\n            '0 1px 2px rgba(0, 0, 0, 0.5), 1px 2px 3px 0 black, inset 5px 6px 7px 8px rgba(0,255,0,0.75)'\n        });\n      });\n    });\n\n    test('fontVariant', () => {\n      expect(\n        preprocess({ fontVariant: 'common-ligatures small-caps' })\n      ).toEqual({\n        fontVariant: 'common-ligatures small-caps'\n      });\n\n      expect(\n        preprocess({ fontVariant: ['common-ligatures', 'small-caps'] })\n      ).toEqual({\n        fontVariant: 'common-ligatures small-caps'\n      });\n    });\n\n    describe('transform', () => {\n      // passthrough if transform value is ever a string\n      test('string', () => {\n        const transform =\n          'perspective(50px) scaleX(20) translateX(20px) rotate(20deg)';\n        const style = { transform };\n        const resolved = preprocess(style);\n\n        expect(resolved).toEqual({ transform });\n      });\n\n      test('array', () => {\n        const style = {\n          transform: [\n            { perspective: 50 },\n            { scaleX: 20 },\n            { translateX: 20 },\n            { rotate: '20deg' },\n            { matrix: [1, 2, 3, 4, 5, 6] },\n            { matrix3d: [1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4] }\n          ]\n        };\n        const resolved = preprocess(style);\n\n        expect(resolved).toEqual({\n          transform:\n            'perspective(50px) scaleX(20) translateX(20px) rotate(20deg) matrix(1,2,3,4,5,6) matrix3d(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4)'\n        });\n      });\n    });\n\n    describe('transformOrigin', () => {\n      // passthrough if transformOrigin value is ever a string\n      test('string', () => {\n        const transformOrigin = '2px 30% 10px';\n        const style = { transformOrigin };\n        const resolved = preprocess(style);\n\n        expect(resolved).toEqual({ transformOrigin });\n      });\n\n      test('array', () => {\n        const style = {\n          transformOrigin: [2, '30%', 10]\n        };\n        const resolved = preprocess(style);\n\n        expect(resolved).toEqual({\n          transformOrigin: '2px 30% 10px'\n        });\n      });\n    });\n  });\n\n  describe('preprocesses multiple shadow styles into a single declaration', () => {\n    test('shadowColor only', () => {\n      expect(preprocess({ shadowColor: 'red' })).toEqual({\n        boxShadow: '0px 0px 0px rgba(255,0,0,1.00)'\n      });\n    });\n\n    test('shadowColor and shadowOpacity only', () => {\n      expect(preprocess({ shadowColor: 'red', shadowOpacity: 0.5 })).toEqual({\n        boxShadow: '0px 0px 0px rgba(255,0,0,0.50)'\n      });\n    });\n\n    test('shadowOffset only', () => {\n      expect(preprocess({ shadowOffset: { width: 1, height: 2 } })).toEqual({\n        boxShadow: '1px 2px 0px rgba(0,0,0,1.00)'\n      });\n    });\n\n    test('shadowRadius only', () => {\n      expect(preprocess({ shadowRadius: 5 })).toEqual({\n        boxShadow: '0px 0px 5px rgba(0,0,0,1.00)'\n      });\n    });\n\n    test('shadowOffset, shadowRadius, shadowColor', () => {\n      expect(\n        preprocess({\n          shadowColor: 'rgba(50,60,70,0.5)',\n          shadowOffset: { width: 1, height: 2 },\n          shadowOpacity: 0.5,\n          shadowRadius: 3\n        })\n      ).toEqual({\n        boxShadow: '1px 2px 3px rgba(50,60,70,0.25)'\n      });\n    });\n\n    test('shadow styles and string boxShadow together', () => {\n      expect(\n        preprocess({\n          shadowColor: 'rgba(50,60,70,0.5)',\n          shadowOffset: { width: 1, height: 2 },\n          shadowOpacity: 0.5,\n          shadowRadius: 3,\n          boxShadow: '4px 5px 6px black'\n        })\n      ).toEqual({\n        boxShadow: '4px 5px 6px black, 1px 2px 3px rgba(50,60,70,0.25)'\n      });\n    });\n\n    test('shadow styles and array boxShadow together', () => {\n      expect(\n        preprocess({\n          shadowColor: 'rgba(50,60,70,0.5)',\n          shadowOffset: { width: 1, height: 2 },\n          shadowOpacity: 0.5,\n          shadowRadius: 3,\n          boxShadow: [\n            {\n              offsetX: 2,\n              offsetY: 3,\n              spreadDistance: 5,\n              color: 'rgba(10,20,30,0.45)',\n              inset: true\n            }\n          ]\n        })\n      ).toEqual({\n        boxShadow:\n          'inset 2px 3px 0 5px rgba(10,20,30,0.45), 1px 2px 3px rgba(50,60,70,0.25)'\n      });\n    });\n  });\n\n  describe('preprocesses multiple textShadow styles into a single declaration', () => {\n    test('textShadowColor only', () => {\n      expect(preprocess({ textShadowColor: 'red' })).toEqual({});\n    });\n\n    test('textShadowOffset only', () => {\n      expect(preprocess({ textShadowOffset: { width: 1, height: 2 } })).toEqual(\n        {}\n      );\n    });\n\n    test('textShadowRadius only', () => {\n      expect(preprocess({ textShadowRadius: 5 })).toEqual({});\n    });\n\n    test('textShadowColor and textShadowOffset only', () => {\n      expect(\n        preprocess({\n          textShadowColor: 'red',\n          textShadowOffset: { width: 0, height: 0 }\n        })\n      ).toEqual({});\n      expect(\n        preprocess({\n          textShadowColor: 'red',\n          textShadowOffset: { width: -1, height: 0 }\n        })\n      ).toEqual({\n        textShadow: '-1px 0px 0px rgba(255,0,0,1.00)'\n      });\n      expect(\n        preprocess({\n          textShadowColor: 'red',\n          textShadowOffset: { width: 1, height: 2 }\n        })\n      ).toEqual({\n        textShadow: '1px 2px 0px rgba(255,0,0,1.00)'\n      });\n    });\n\n    test('textShadowColor and textShadowRadius only', () => {\n      expect(\n        preprocess({ textShadowColor: 'red', textShadowRadius: 0 })\n      ).toEqual({});\n      expect(\n        preprocess({ textShadowColor: 'red', textShadowRadius: 5 })\n      ).toEqual({\n        textShadow: '0px 0px 5px rgba(255,0,0,1.00)'\n      });\n    });\n\n    test('textShadowColor, textShadowOffset, textShadowRadius', () => {\n      expect(\n        preprocess({\n          textShadowColor: 'rgba(50,60,70,0.50)',\n          textShadowOffset: { width: 5, height: 10 },\n          textShadowRadius: 15\n        })\n      ).toEqual({\n        textShadow: '5px 10px 15px rgba(50,60,70,0.50)'\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/__tests__/validate-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport { validate } from '../validate';\n\ndescribe('validate', () => {\n  beforeAll(() => {\n    jest.spyOn(console, 'error').mockImplementation(() => {});\n  });\n  afterAll(() => {\n    console.error.mockRestore();\n  });\n  afterEach(() => {\n    console.error.mockClear();\n  });\n\n  test('invalid shortform properties', () => {\n    validate({ background: 'red' });\n    validate({ font: 'arial' });\n    validate({ borderTop: '1px solid red' });\n    expect(console.error).toHaveBeenCalled();\n  });\n\n  test('valid shortform values', () => {\n    validate({ flex: 1 });\n    validate({ margin: 10 });\n    validate({ margin: 'calc(10 * 1px)' });\n    validate({ margin: 'calc(10 * calc(10 * 1px))' });\n    expect(console.error).not.toHaveBeenCalled();\n  });\n\n  test('invalid shortform multi-values', () => {\n    validate({ flex: '1 1 25%' });\n    validate({ margin: '10px 20px' });\n    validate({ margin: 'calc(10 * 1px) var(--test)' });\n    expect(console.error).toHaveBeenCalledTimes(3);\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/compiler/createReactDOMStyle.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nimport normalizeValueWithProperty from './normalizeValueWithProperty';\nimport canUseDOM from '../../../modules/canUseDom';\n\ntype Style = { [key: string]: any };\n\n/**\n * The browser implements the CSS cascade, where the order of properties is a\n * factor in determining which styles to paint. React Native is different. It\n * gives giving precedence to the more specific style property. For example,\n * the value of `paddingTop` takes precedence over that of `padding`.\n *\n * This module creates mutally exclusive style declarations by expanding all of\n * React Native's supported shortform properties (e.g. `padding`) to their\n * longfrom equivalents.\n */\n\nconst emptyObject = {};\n\nconst supportsCSS3TextDecoration =\n  !canUseDOM ||\n  (window.CSS != null &&\n    window.CSS.supports != null &&\n    (window.CSS.supports('text-decoration-line', 'none') ||\n      window.CSS.supports('-webkit-text-decoration-line', 'none')));\n\nconst MONOSPACE_FONT_STACK = 'monospace,monospace';\n\nconst SYSTEM_FONT_STACK =\n  '-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif';\n\nconst STYLE_SHORT_FORM_EXPANSIONS = {\n  borderColor: [\n    'borderTopColor',\n    'borderRightColor',\n    'borderBottomColor',\n    'borderLeftColor'\n  ],\n  borderBlockColor: ['borderTopColor', 'borderBottomColor'],\n  borderInlineColor: ['borderRightColor', 'borderLeftColor'],\n  borderRadius: [\n    'borderTopLeftRadius',\n    'borderTopRightRadius',\n    'borderBottomRightRadius',\n    'borderBottomLeftRadius'\n  ],\n  borderStyle: [\n    'borderTopStyle',\n    'borderRightStyle',\n    'borderBottomStyle',\n    'borderLeftStyle'\n  ],\n  borderBlockStyle: ['borderTopStyle', 'borderBottomStyle'],\n  borderInlineStyle: ['borderRightStyle', 'borderLeftStyle'],\n  borderWidth: [\n    'borderTopWidth',\n    'borderRightWidth',\n    'borderBottomWidth',\n    'borderLeftWidth'\n  ],\n  borderBlockWidth: ['borderTopWidth', 'borderBottomWidth'],\n  borderInlineWidth: ['borderRightWidth', 'borderLeftWidth'],\n  insetBlock: ['top', 'bottom'],\n  insetInline: ['left', 'right'],\n  marginBlock: ['marginTop', 'marginBottom'],\n  marginInline: ['marginRight', 'marginLeft'],\n  paddingBlock: ['paddingTop', 'paddingBottom'],\n  paddingInline: ['paddingRight', 'paddingLeft'],\n  overflow: ['overflowX', 'overflowY'],\n  overscrollBehavior: ['overscrollBehaviorX', 'overscrollBehaviorY'],\n  borderBlockStartColor: ['borderTopColor'],\n  borderBlockStartStyle: ['borderTopStyle'],\n  borderBlockStartWidth: ['borderTopWidth'],\n  borderBlockEndColor: ['borderBottomColor'],\n  borderBlockEndStyle: ['borderBottomStyle'],\n  borderBlockEndWidth: ['borderBottomWidth'],\n  //borderInlineStartColor: ['borderLeftColor'],\n  //borderInlineStartStyle: ['borderLeftStyle'],\n  //borderInlineStartWidth: ['borderLeftWidth'],\n  //borderInlineEndColor: ['borderRightColor'],\n  //borderInlineEndStyle: ['borderRightStyle'],\n  //borderInlineEndWidth: ['borderRightWidth'],\n  borderEndStartRadius: ['borderBottomLeftRadius'],\n  borderEndEndRadius: ['borderBottomRightRadius'],\n  borderStartStartRadius: ['borderTopLeftRadius'],\n  borderStartEndRadius: ['borderTopRightRadius'],\n  insetBlockEnd: ['bottom'],\n  insetBlockStart: ['top'],\n  //insetInlineEnd: ['right'],\n  //insetInlineStart: ['left'],\n  marginBlockStart: ['marginTop'],\n  marginBlockEnd: ['marginBottom'],\n  //marginInlineStart: ['marginLeft'],\n  //marginInlineEnd: ['marginRight'],\n  paddingBlockStart: ['paddingTop'],\n  paddingBlockEnd: ['paddingBottom']\n  //paddingInlineStart: ['marginLeft'],\n  //paddingInlineEnd: ['marginRight'],\n};\n\n/**\n * Reducer\n */\n\nconst createReactDOMStyle = (style: Style, isInline?: boolean): Style => {\n  if (!style) {\n    return emptyObject;\n  }\n\n  const resolvedStyle = {};\n\n  for (const prop in style) {\n    const value = style[prop];\n\n    if (\n      // Ignore everything with a null value\n      value == null\n    ) {\n      continue;\n    }\n\n    if (prop === 'backgroundClip') {\n      // TODO: remove once this issue is fixed\n      // https://github.com/rofrischmann/inline-style-prefixer/issues/159\n      if (value === 'text') {\n        resolvedStyle.backgroundClip = value;\n        resolvedStyle.WebkitBackgroundClip = value;\n      }\n    } else if (prop === 'flex') {\n      if (value === -1) {\n        resolvedStyle.flexGrow = 0;\n        resolvedStyle.flexShrink = 1;\n        resolvedStyle.flexBasis = 'auto';\n      } else {\n        resolvedStyle.flex = value;\n      }\n    } else if (prop === 'font') {\n      resolvedStyle[prop] = value.replace('System', SYSTEM_FONT_STACK);\n    } else if (prop === 'fontFamily') {\n      if (value.indexOf('System') > -1) {\n        const stack = value.split(/,\\s*/);\n        stack[stack.indexOf('System')] = SYSTEM_FONT_STACK;\n        resolvedStyle[prop] = stack.join(',');\n      } else if (value === 'monospace') {\n        resolvedStyle[prop] = MONOSPACE_FONT_STACK;\n      } else {\n        resolvedStyle[prop] = value;\n      }\n    } else if (prop === 'textDecorationLine') {\n      // use 'text-decoration' for browsers that only support CSS2\n      // text-decoration (e.g., IE, Edge)\n      if (!supportsCSS3TextDecoration) {\n        resolvedStyle.textDecoration = value;\n      } else {\n        resolvedStyle.textDecorationLine = value;\n      }\n    } else if (prop === 'writingDirection') {\n      resolvedStyle.direction = value;\n    } else {\n      const value = normalizeValueWithProperty(style[prop], prop);\n      const longFormProperties = STYLE_SHORT_FORM_EXPANSIONS[prop];\n      if (isInline && prop === 'inset') {\n        if (style.insetInline == null) {\n          resolvedStyle.left = value;\n          resolvedStyle.right = value;\n        }\n        if (style.insetBlock == null) {\n          resolvedStyle.top = value;\n          resolvedStyle.bottom = value;\n        }\n      } else if (isInline && prop === 'margin') {\n        if (style.marginInline == null) {\n          resolvedStyle.marginLeft = value;\n          resolvedStyle.marginRight = value;\n        }\n        if (style.marginBlock == null) {\n          resolvedStyle.marginTop = value;\n          resolvedStyle.marginBottom = value;\n        }\n      } else if (isInline && prop === 'padding') {\n        if (style.paddingInline == null) {\n          resolvedStyle.paddingLeft = value;\n          resolvedStyle.paddingRight = value;\n        }\n        if (style.paddingBlock == null) {\n          resolvedStyle.paddingTop = value;\n          resolvedStyle.paddingBottom = value;\n        }\n      } else if (longFormProperties) {\n        longFormProperties.forEach((longForm, i) => {\n          // The value of any longform property in the original styles takes\n          // precedence over the shortform's value.\n          if (style[longForm] == null) {\n            resolvedStyle[longForm] = value;\n          }\n        });\n      } else {\n        resolvedStyle[prop] = value;\n      }\n    }\n  }\n\n  return resolvedStyle;\n};\n\nexport default createReactDOMStyle;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/compiler/hash.js",
    "content": "/* eslint-disable */\n\n/**\n * JS Implementation of MurmurHash2\n *\n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\n * @see http://github.com/garycourt/murmurhash-js\n * @author <a href=\"mailto:aappleby@gmail.com\">Austin Appleby</a>\n * @see http://sites.google.com/site/murmurhash/\n *\n * @param {string} str ASCII only\n * @param {number} seed Positive integer only\n * @return {number} 32-bit positive integer hash\n *\n * @flow\n */\n\nfunction murmurhash2_32_gc(str, seed) {\n  var l = str.length,\n    h = seed ^ l,\n    i = 0,\n    k;\n\n  while (l >= 4) {\n    k =\n      (str.charCodeAt(i) & 0xff) |\n      ((str.charCodeAt(++i) & 0xff) << 8) |\n      ((str.charCodeAt(++i) & 0xff) << 16) |\n      ((str.charCodeAt(++i) & 0xff) << 24);\n\n    k =\n      (k & 0xffff) * 0x5bd1e995 + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16);\n    k ^= k >>> 24;\n    k =\n      (k & 0xffff) * 0x5bd1e995 + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16);\n\n    h =\n      ((h & 0xffff) * 0x5bd1e995 +\n        ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)) ^\n      k;\n\n    l -= 4;\n    ++i;\n  }\n\n  switch (l) {\n    case 3:\n      h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n    case 2:\n      h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n    case 1:\n      h ^= str.charCodeAt(i) & 0xff;\n      h =\n        (h & 0xffff) * 0x5bd1e995 +\n        ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16);\n  }\n\n  h ^= h >>> 13;\n  h = (h & 0xffff) * 0x5bd1e995 + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16);\n  h ^= h >>> 15;\n\n  return h >>> 0;\n}\n\nconst hash = (str: string): string => murmurhash2_32_gc(str, 1).toString(36);\n\nexport default hash;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/compiler/hyphenateStyleName.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow strict\n */\n\nconst uppercasePattern = /[A-Z]/g;\nconst msPattern = /^ms-/;\nconst cache = {};\n\nfunction toHyphenLower(match) {\n  return '-' + match.toLowerCase();\n}\n\nfunction hyphenateStyleName(name: string): string {\n  if (name in cache) {\n    return cache[name];\n  }\n\n  const hName = name.replace(uppercasePattern, toHyphenLower);\n  return (cache[name] = msPattern.test(hName) ? '-' + hName : hName);\n}\n\nexport default hyphenateStyleName;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/compiler/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow strict-local\n */\n\nimport createReactDOMStyle from './createReactDOMStyle';\nimport hash from './hash';\nimport hyphenateStyleName from './hyphenateStyleName';\nimport normalizeValueWithProperty from './normalizeValueWithProperty';\nimport prefixStyles from '../../../modules/prefixStyles';\n\ntype Value = Object | Array<any> | string | number;\ntype Style = { [key: string]: Value };\ntype Rule = string;\ntype Rules = Array<Rule>;\ntype RulesData = [Rules, number];\ntype CompiledStyle = {\n  $$css: boolean,\n  $$css$localize?: boolean,\n  [key: string]: string | Array<string>\n};\ntype CompilerOutput = [CompiledStyle, Array<RulesData>];\n\nconst cache = new Map();\nconst emptyObject = {};\n\nconst classicGroup = 1;\nconst atomicGroup = 3;\nconst customGroup: { [key: string]: number } = {\n  borderColor: 2,\n  borderRadius: 2,\n  borderStyle: 2,\n  borderWidth: 2,\n  display: 2,\n  flex: 2,\n  inset: 2,\n  margin: 2,\n  overflow: 2,\n  overscrollBehavior: 2,\n  padding: 2,\n  insetBlock: 2.1,\n  insetInline: 2.1,\n  marginInline: 2.1,\n  marginBlock: 2.1,\n  paddingInline: 2.1,\n  paddingBlock: 2.1,\n  borderBlockStartColor: 2.2,\n  borderBlockStartStyle: 2.2,\n  borderBlockStartWidth: 2.2,\n  borderBlockEndColor: 2.2,\n  borderBlockEndStyle: 2.2,\n  borderBlockEndWidth: 2.2,\n  borderInlineStartColor: 2.2,\n  borderInlineStartStyle: 2.2,\n  borderInlineStartWidth: 2.2,\n  borderInlineEndColor: 2.2,\n  borderInlineEndStyle: 2.2,\n  borderInlineEndWidth: 2.2,\n  borderEndStartRadius: 2.2,\n  borderEndEndRadius: 2.2,\n  borderStartStartRadius: 2.2,\n  borderStartEndRadius: 2.2,\n  insetBlockEnd: 2.2,\n  insetBlockStart: 2.2,\n  insetInlineEnd: 2.2,\n  insetInlineStart: 2.2,\n  marginBlockStart: 2.2,\n  marginBlockEnd: 2.2,\n  marginInlineStart: 2.2,\n  marginInlineEnd: 2.2,\n  paddingBlockStart: 2.2,\n  paddingBlockEnd: 2.2,\n  paddingInlineStart: 2.2,\n  paddingInlineEnd: 2.2\n};\n\nconst borderTopLeftRadius = 'borderTopLeftRadius';\nconst borderTopRightRadius = 'borderTopRightRadius';\nconst borderBottomLeftRadius = 'borderBottomLeftRadius';\nconst borderBottomRightRadius = 'borderBottomRightRadius';\nconst borderLeftColor = 'borderLeftColor';\nconst borderLeftStyle = 'borderLeftStyle';\nconst borderLeftWidth = 'borderLeftWidth';\nconst borderRightColor = 'borderRightColor';\nconst borderRightStyle = 'borderRightStyle';\nconst borderRightWidth = 'borderRightWidth';\nconst right = 'right';\nconst marginLeft = 'marginLeft';\nconst marginRight = 'marginRight';\nconst paddingLeft = 'paddingLeft';\nconst paddingRight = 'paddingRight';\nconst left = 'left';\n\n// Map of LTR property names to their BiDi equivalent.\nconst PROPERTIES_FLIP: { [key: string]: string } = {\n  [borderTopLeftRadius]: borderTopRightRadius,\n  [borderTopRightRadius]: borderTopLeftRadius,\n  [borderBottomLeftRadius]: borderBottomRightRadius,\n  [borderBottomRightRadius]: borderBottomLeftRadius,\n  [borderLeftColor]: borderRightColor,\n  [borderLeftStyle]: borderRightStyle,\n  [borderLeftWidth]: borderRightWidth,\n  [borderRightColor]: borderLeftColor,\n  [borderRightStyle]: borderLeftStyle,\n  [borderRightWidth]: borderLeftWidth,\n  [left]: right,\n  [marginLeft]: marginRight,\n  [marginRight]: marginLeft,\n  [paddingLeft]: paddingRight,\n  [paddingRight]: paddingLeft,\n  [right]: left\n};\n\n// Map of I18N property names to their LTR equivalent.\nconst PROPERTIES_I18N: { [key: string]: string } = {\n  borderStartStartRadius: borderTopLeftRadius,\n  borderStartEndRadius: borderTopRightRadius,\n  borderEndStartRadius: borderBottomLeftRadius,\n  borderEndEndRadius: borderBottomRightRadius,\n  borderInlineStartColor: borderLeftColor,\n  borderInlineStartStyle: borderLeftStyle,\n  borderInlineStartWidth: borderLeftWidth,\n  borderInlineEndColor: borderRightColor,\n  borderInlineEndStyle: borderRightStyle,\n  borderInlineEndWidth: borderRightWidth,\n  insetInlineEnd: right,\n  insetInlineStart: left,\n  marginInlineStart: marginLeft,\n  marginInlineEnd: marginRight,\n  paddingInlineStart: paddingLeft,\n  paddingInlineEnd: paddingRight\n};\n\nconst PROPERTIES_VALUE = ['clear', 'float', 'textAlign'];\n\nexport function atomic(style: Style): CompilerOutput {\n  const compiledStyle: CompiledStyle = { $$css: true };\n  const compiledRules = [];\n\n  function atomicCompile(srcProp, prop, value) {\n    const valueString = stringifyValueWithProperty(value, prop);\n    const cacheKey = prop + valueString;\n    const cachedResult = cache.get(cacheKey);\n    let identifier;\n    if (cachedResult != null) {\n      identifier = cachedResult[0];\n      compiledRules.push(cachedResult[1]);\n    } else {\n      const v = srcProp !== prop ? cacheKey : valueString;\n      identifier = createIdentifier('r', srcProp, v);\n      const order = customGroup[srcProp] || atomicGroup;\n      const rules = createAtomicRules(identifier, prop, value);\n      const orderedRules = [rules, order];\n      compiledRules.push(orderedRules);\n      cache.set(cacheKey, [identifier, orderedRules]);\n    }\n    return identifier;\n  }\n\n  Object.keys(style)\n    .sort()\n    .forEach((srcProp) => {\n      const value = style[srcProp];\n      if (value != null) {\n        let localizeableValue;\n        // BiDi flip values\n        if (PROPERTIES_VALUE.indexOf(srcProp) > -1) {\n          const left = atomicCompile(srcProp, srcProp, 'left');\n          const right = atomicCompile(srcProp, srcProp, 'right');\n          if (value === 'start') {\n            localizeableValue = [left, right];\n          } else if (value === 'end') {\n            localizeableValue = [right, left];\n          }\n        }\n        // BiDi flip properties\n        const propPolyfill = PROPERTIES_I18N[srcProp];\n        if (propPolyfill != null) {\n          const ltr = atomicCompile(srcProp, propPolyfill, value);\n          const rtl = atomicCompile(\n            srcProp,\n            PROPERTIES_FLIP[propPolyfill],\n            value\n          );\n          localizeableValue = [ltr, rtl];\n        }\n        // BiDi flip transitionProperty value\n        if (srcProp === 'transitionProperty') {\n          const values = Array.isArray(value) ? value : [value];\n          const polyfillIndices = [];\n\n          for (let i = 0; i < values.length; i++) {\n            const val = values[i];\n            if (typeof val === 'string' && PROPERTIES_I18N[val] != null) {\n              polyfillIndices.push(i);\n            }\n          }\n\n          if (polyfillIndices.length > 0) {\n            const ltrPolyfillValues = [...values];\n            const rtlPolyfillValues = [...values];\n            polyfillIndices.forEach((i) => {\n              const ltrVal = ltrPolyfillValues[i];\n              if (typeof ltrVal === 'string') {\n                const ltrPolyfill = PROPERTIES_I18N[ltrVal];\n                const rtlPolyfill = PROPERTIES_FLIP[ltrPolyfill];\n                ltrPolyfillValues[i] = ltrPolyfill;\n                rtlPolyfillValues[i] = rtlPolyfill;\n                const ltr = atomicCompile(srcProp, srcProp, ltrPolyfillValues);\n                const rtl = atomicCompile(srcProp, srcProp, rtlPolyfillValues);\n                localizeableValue = [ltr, rtl];\n              }\n            });\n          }\n        }\n\n        if (localizeableValue == null) {\n          localizeableValue = atomicCompile(srcProp, srcProp, value);\n        } else {\n          compiledStyle['$$css$localize'] = true;\n        }\n\n        compiledStyle[srcProp] = localizeableValue;\n      }\n    });\n\n  return [compiledStyle, compiledRules];\n}\n\n/**\n * Compile simple style object to classic CSS rules.\n * No support for 'placeholderTextColor', 'scrollbarWidth', or 'pointerEvents'.\n */\nexport function classic(style: Style, name: string): CompilerOutput {\n  const compiledStyle = { $$css: true };\n  const compiledRules = [];\n\n  const { animationKeyframes, ...rest } = style;\n  const identifier = createIdentifier('css', name, JSON.stringify(style));\n  const selector = `.${identifier}`;\n  let animationName;\n  if (animationKeyframes != null) {\n    const [animationNames, keyframesRules] =\n      processKeyframesValue(animationKeyframes);\n    animationName = animationNames.join(',');\n    compiledRules.push(...keyframesRules);\n  }\n  const block = createDeclarationBlock({ ...rest, animationName });\n  compiledRules.push(`${selector}${block}`);\n\n  compiledStyle[identifier] = identifier;\n  return [compiledStyle, [[compiledRules, classicGroup]]];\n}\n\n/**\n * Compile simple style object to inline DOM styles.\n * No support for 'animationKeyframes', 'placeholderTextColor', 'scrollbarWidth', or 'pointerEvents'.\n */\nexport function inline(\n  originalStyle: Style,\n  isRTL?: boolean\n): { [key: string]: mixed } {\n  const style = originalStyle || emptyObject;\n  const frozenProps = {};\n  const nextStyle = {};\n\n  for (const originalProp in style) {\n    const originalValue = style[originalProp];\n    let prop = originalProp;\n    let value = originalValue;\n\n    if (\n      !Object.prototype.hasOwnProperty.call(style, originalProp) ||\n      originalValue == null\n    ) {\n      continue;\n    }\n\n    // BiDi flip values\n    if (PROPERTIES_VALUE.indexOf(originalProp) > -1) {\n      if (originalValue === 'start') {\n        value = isRTL ? 'right' : 'left';\n      } else if (originalValue === 'end') {\n        value = isRTL ? 'left' : 'right';\n      }\n    }\n    // BiDi flip properties\n    const propPolyfill = PROPERTIES_I18N[originalProp];\n    if (propPolyfill != null) {\n      prop = isRTL ? PROPERTIES_FLIP[propPolyfill] : propPolyfill;\n    }\n    // BiDi flip transitionProperty value\n    if (originalProp === 'transitionProperty') {\n      // $FlowFixMe\n      const originalValues = Array.isArray(originalValue)\n        ? originalValue\n        : [originalValue];\n      originalValues.forEach((val, i) => {\n        if (typeof val === 'string') {\n          const valuePolyfill = PROPERTIES_I18N[val];\n          if (valuePolyfill != null) {\n            originalValues[i] = isRTL\n              ? PROPERTIES_FLIP[valuePolyfill]\n              : valuePolyfill;\n\n            value = originalValues.join(' ');\n          }\n        }\n      });\n    }\n\n    // Create finalized style\n    if (!frozenProps[prop]) {\n      nextStyle[prop] = value;\n    }\n\n    if (prop === originalProp) {\n      frozenProps[prop] = true;\n    }\n\n    //    if (PROPERTIES_I18N.hasOwnProperty(originalProp)) {\n    //    frozenProps[prop] = true;\n    //}\n  }\n\n  return createReactDOMStyle(nextStyle, true);\n}\n\n/**\n * Create a value string that normalizes different input values with a common\n * output.\n */\nexport function stringifyValueWithProperty(\n  value: Value,\n  property: ?string\n): string {\n  // e.g., 0 => '0px', 'black' => 'rgba(0,0,0,1)'\n  const normalizedValue = normalizeValueWithProperty(value, property);\n  return typeof normalizedValue !== 'string'\n    ? JSON.stringify(normalizedValue || '')\n    : normalizedValue;\n}\n\n/**\n * Create the Atomic CSS rules needed for a given StyleSheet rule.\n * Translates StyleSheet declarations to CSS.\n */\nfunction createAtomicRules(identifier: string, property, value): Rules {\n  const rules = [];\n  const selector = `.${identifier}`;\n\n  // Handle non-standard properties and object values that require multiple\n  // CSS rules to be created.\n  switch (property) {\n    case 'animationKeyframes': {\n      const [animationNames, keyframesRules] = processKeyframesValue(value);\n      const block = createDeclarationBlock({\n        animationName: animationNames.join(',')\n      });\n      rules.push(`${selector}${block}`, ...keyframesRules);\n      break;\n    }\n\n    // Equivalent to using '::placeholder'\n    case 'placeholderTextColor': {\n      const block = createDeclarationBlock({ color: value, opacity: 1 });\n      rules.push(\n        `${selector}::-webkit-input-placeholder${block}`,\n        `${selector}::-moz-placeholder${block}`,\n        `${selector}:-ms-input-placeholder${block}`,\n        `${selector}::placeholder${block}`\n      );\n      break;\n    }\n\n    // Polyfill for additional 'pointer-events' values\n    // See d13f78622b233a0afc0c7a200c0a0792c8ca9e58\n    // See https://reactnative.dev/docs/view#pointerevents\n    case 'pointerEvents': {\n      let finalValue = value;\n      if (value === 'auto') {\n        finalValue = 'auto!important';\n      } else if (value === 'none') {\n        finalValue = 'none!important';\n        const block = createDeclarationBlock({ pointerEvents: 'none' });\n        rules.push(`${selector}>* ${block}`);\n      } else if (value === 'box-none') {\n        finalValue = 'none!important';\n        const block = createDeclarationBlock({ pointerEvents: 'auto' });\n        rules.push(`${selector}>* ${block}`);\n      } else if (value === 'box-only') {\n        finalValue = 'auto!important';\n        const block = createDeclarationBlock({ pointerEvents: 'none' });\n        rules.push(`${selector}>* ${block}`);\n      }\n      const block = createDeclarationBlock({ pointerEvents: finalValue });\n      rules.push(`${selector}${block}`);\n      break;\n    }\n\n    // Polyfill for draft spec\n    // https://drafts.csswg.org/css-scrollbars-1/\n    case 'scrollbarWidth': {\n      if (value === 'none') {\n        rules.push(`${selector}::-webkit-scrollbar{display:none}`);\n      }\n      const block = createDeclarationBlock({ scrollbarWidth: value });\n      rules.push(`${selector}${block}`);\n      break;\n    }\n\n    default: {\n      const block = createDeclarationBlock({ [property]: value });\n      rules.push(`${selector}${block}`);\n      break;\n    }\n  }\n\n  return rules;\n}\n\n/**\n * Creates a CSS declaration block from a StyleSheet object.\n */\nfunction createDeclarationBlock(style: Style): string {\n  const domStyle = prefixStyles(createReactDOMStyle(style));\n  const declarationsString = Object.keys(domStyle)\n    .map((property) => {\n      const value = domStyle[property];\n      const prop = hyphenateStyleName(property);\n      // The prefixer may return an array of values:\n      // { display: [ '-webkit-flex', 'flex' ] }\n      // to represent \"fallback\" declarations\n      // { display: -webkit-flex; display: flex; }\n      if (Array.isArray(value)) {\n        return value.map((v) => `${prop}:${v}`).join(';');\n      } else {\n        return `${prop}:${value}`;\n      }\n    })\n    // Once properties are hyphenated, this will put the vendor\n    // prefixed and short-form properties first in the list.\n    .sort()\n    .join(';');\n\n  return `{${declarationsString};}`;\n}\n\n/**\n * An identifier is associated with a unique set of styles.\n */\nfunction createIdentifier(prefix: string, name: string, key: string): string {\n  const hashedString = hash(name + key);\n  return process.env.NODE_ENV !== 'production'\n    ? `${prefix}-${name}-${hashedString}`\n    : `${prefix}-${hashedString}`;\n}\n\n/**\n * Create individual CSS keyframes rules.\n */\nfunction createKeyframes(keyframes: Object): [string, Rules] {\n  const prefixes = ['-webkit-', ''];\n  const identifier = createIdentifier(\n    'r',\n    'animation',\n    JSON.stringify(keyframes)\n  );\n\n  const steps =\n    '{' +\n    Object.keys(keyframes)\n      .map((stepName) => {\n        const rule = keyframes[stepName];\n        const block = createDeclarationBlock(rule);\n        return `${stepName}${block}`;\n      })\n      .join('') +\n    '}';\n\n  const rules = prefixes.map((prefix) => {\n    return `@${prefix}keyframes ${identifier}${steps}`;\n  });\n  return [identifier, rules];\n}\n\n/**\n * Create CSS keyframes rules and names from a StyleSheet keyframes object.\n */\nfunction processKeyframesValue(keyframesValue) {\n  if (typeof keyframesValue === 'number') {\n    throw new Error(`Invalid CSS keyframes type: ${typeof keyframesValue}`);\n  }\n\n  const animationNames = [];\n  const rules = [];\n  const value = Array.isArray(keyframesValue)\n    ? keyframesValue\n    : [keyframesValue];\n\n  value.forEach((keyframes) => {\n    if (typeof keyframes === 'string') {\n      // Support external animation libraries (identifiers only)\n      animationNames.push(keyframes);\n    } else {\n      // Create rules for each of the keyframes\n      const [identifier, keyframesRules] = createKeyframes(keyframes);\n      animationNames.push(identifier);\n      rules.push(...keyframesRules);\n    }\n  });\n\n  return [animationNames, rules];\n}\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/compiler/normalizeColor.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nimport isWebColor from '../../../modules/isWebColor';\nimport processColor from '../../../exports/processColor';\n\nconst normalizeColor = (\n  color?: number | string,\n  opacity?: number = 1\n): void | string => {\n  if (color == null) return;\n\n  if (typeof color === 'string' && isWebColor(color)) {\n    return color;\n  }\n\n  const colorInt = processColor(color);\n  if (colorInt != null) {\n    const r = (colorInt >> 16) & 255;\n    const g = (colorInt >> 8) & 255;\n    const b = colorInt & 255;\n    const a = ((colorInt >> 24) & 255) / 255;\n    const alpha = (a * opacity).toFixed(2);\n    return `rgba(${r},${g},${b},${alpha})`;\n  }\n};\n\nexport default normalizeColor;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/compiler/normalizeValueWithProperty.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow strict-local\n */\n\nimport unitlessNumbers from './unitlessNumbers';\nimport normalizeColor from './normalizeColor';\n\nconst colorProps = {\n  backgroundColor: true,\n  borderColor: true,\n  borderTopColor: true,\n  borderRightColor: true,\n  borderBottomColor: true,\n  borderLeftColor: true,\n  color: true,\n  shadowColor: true,\n  textDecorationColor: true,\n  textShadowColor: true\n};\n\nexport default function normalizeValueWithProperty(\n  value: any,\n  property?: ?string\n): any {\n  let returnValue = value;\n  if (\n    (property == null || !unitlessNumbers[property]) &&\n    typeof value === 'number'\n  ) {\n    returnValue = `${value}px`;\n  } else if (property != null && colorProps[property]) {\n    returnValue = normalizeColor(value);\n  }\n  return returnValue;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/compiler/resolveShadowValue.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nimport normalizeColor from './normalizeColor';\nimport normalizeValueWithProperty from './normalizeValueWithProperty';\n\nconst defaultOffset = { height: 0, width: 0 };\n\nconst resolveShadowValue = (style: Object): void | string => {\n  const { shadowColor, shadowOffset, shadowOpacity, shadowRadius } = style;\n  const { height, width } = shadowOffset || defaultOffset;\n  const offsetX = normalizeValueWithProperty(width);\n  const offsetY = normalizeValueWithProperty(height);\n  const blurRadius = normalizeValueWithProperty(shadowRadius || 0);\n  const color = normalizeColor(shadowColor || 'black', shadowOpacity);\n  if (\n    color != null &&\n    offsetX != null &&\n    offsetY != null &&\n    blurRadius != null\n  ) {\n    return `${offsetX} ${offsetY} ${blurRadius} ${color}`;\n  }\n};\n\nexport default resolveShadowValue;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/compiler/unitlessNumbers.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nconst unitlessNumbers = {\n  animationIterationCount: true,\n  aspectRatio: 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  flexOrder: true,\n  flexPositive: true,\n  flexShrink: true,\n  flexNegative: true,\n  fontWeight: true,\n  gridRow: true,\n  gridRowEnd: true,\n  gridRowGap: true,\n  gridRowStart: true,\n  gridColumn: true,\n  gridColumnEnd: true,\n  gridColumnGap: true,\n  gridColumnStart: true,\n  lineClamp: true,\n  opacity: true,\n  order: true,\n  orphans: true,\n  tabSize: true,\n  widows: true,\n  zIndex: true,\n  zoom: true,\n  // SVG-related\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  // transform types\n  scale: true,\n  scaleX: true,\n  scaleY: true,\n  scaleZ: true,\n  // RN properties\n  shadowOpacity: true\n};\n\n/**\n * Support style names that may come passed in prefixed by adding permutations\n * of vendor prefixes.\n */\nconst prefixes = ['ms', 'Moz', 'O', 'Webkit'];\nconst prefixKey = (prefix: string, key: string) => {\n  return prefix + key.charAt(0).toUpperCase() + key.substring(1);\n};\nObject.keys(unitlessNumbers).forEach((prop) => {\n  prefixes.forEach((prefix) => {\n    unitlessNumbers[prefixKey(prefix, prop)] = unitlessNumbers[prop];\n  });\n});\n\nexport default unitlessNumbers;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/dom/createCSSStyleSheet.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow strict-local\n */\nimport canUseDOM from '../../../modules/canUseDom';\n\n// $FlowFixMe: HTMLStyleElement is incorrectly typed - https://github.com/facebook/flow/issues/2696\nexport default function createCSSStyleSheet(\n  id: string,\n  rootNode?: Document | ShadowRoot,\n  textContent?: string\n): ?CSSStyleSheet {\n  if (canUseDOM) {\n    const root = rootNode != null ? rootNode : document;\n    let element = root.getElementById(id);\n    if (element == null) {\n      element = document.createElement('style');\n      element.setAttribute('id', id);\n      if (typeof textContent === 'string') {\n        element.appendChild(document.createTextNode(textContent));\n      }\n      if (root instanceof ShadowRoot) {\n        root.insertBefore(element, root.firstChild);\n      } else {\n        const head = root.head;\n        if (head) {\n          head.insertBefore(element, head.firstChild);\n        }\n      }\n    }\n    // $FlowFixMe: HTMLElement is incorrectly typed\n    return element.sheet;\n  } else {\n    return null;\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/dom/createOrderedCSSStyleSheet.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow strict-local\n */\n\ntype Groups = { [key: number]: { start: ?number, rules: Array<string> } };\ntype Selectors = { [key: string]: boolean };\n\nexport type OrderedCSSStyleSheet = {|\n  getTextContent: () => string,\n  insert: (cssText: string, groupValue: number) => void\n|};\n\nconst slice = Array.prototype.slice;\n\n/**\n * Order-based insertion of CSS.\n *\n * Each rule is associated with a numerically defined group.\n * Groups are ordered within the style sheet according to their number, with the\n * lowest first.\n *\n * Groups are implemented using marker rules. The selector of the first rule of\n * each group is used only to encode the group number for hydration. An\n * alternative implementation could rely on CSSMediaRule, allowing groups to be\n * treated as a sub-sheet, but the Edge implementation of CSSMediaRule is\n * broken.\n * https://developer.mozilla.org/en-US/docs/Web/API/CSSMediaRule\n * https://gist.github.com/necolas/aa0c37846ad6bd3b05b727b959e82674\n */\nexport default function createOrderedCSSStyleSheet(\n  sheet: ?CSSStyleSheet\n): OrderedCSSStyleSheet {\n  const groups: Groups = {};\n  const selectors: Selectors = {};\n\n  /**\n   * Hydrate approximate record from any existing rules in the sheet.\n   */\n  if (sheet != null) {\n    let group;\n    slice.call(sheet.cssRules).forEach((cssRule, i) => {\n      const cssText = cssRule.cssText;\n      // Create record of existing selectors and rules\n      if (cssText.indexOf('stylesheet-group') > -1) {\n        group = decodeGroupRule(cssRule);\n        groups[group] = { start: i, rules: [cssText] };\n      } else {\n        const selectorText = getSelectorText(cssText);\n        if (selectorText != null) {\n          selectors[selectorText] = true;\n          groups[group].rules.push(cssText);\n        }\n      }\n    });\n  }\n\n  function sheetInsert(sheet, group, text) {\n    const orderedGroups = getOrderedGroups(groups);\n    const groupIndex = orderedGroups.indexOf(group);\n    const nextGroupIndex = groupIndex + 1;\n    const nextGroup = orderedGroups[nextGroupIndex];\n    // Insert rule before the next group, or at the end of the stylesheet\n    const position =\n      nextGroup != null && groups[nextGroup].start != null\n        ? groups[nextGroup].start\n        : sheet.cssRules.length;\n    const isInserted = insertRuleAt(sheet, text, position);\n\n    if (isInserted) {\n      // Set the starting index of the new group\n      if (groups[group].start == null) {\n        groups[group].start = position;\n      }\n      // Increment the starting index of all subsequent groups\n      for (let i = nextGroupIndex; i < orderedGroups.length; i += 1) {\n        const groupNumber = orderedGroups[i];\n        const previousStart = groups[groupNumber].start || 0;\n        groups[groupNumber].start = previousStart + 1;\n      }\n    }\n\n    return isInserted;\n  }\n\n  const OrderedCSSStyleSheet = {\n    /**\n     * The textContent of the style sheet.\n     */\n    getTextContent(): string {\n      return getOrderedGroups(groups)\n        .map((group) => {\n          const rules = groups[group].rules;\n          // Sorting provides deterministic order of styles in group for\n          // build-time extraction of the style sheet.\n          const marker = rules.shift();\n          rules.sort();\n          rules.unshift(marker);\n          return rules.join('\\n');\n        })\n        .join('\\n');\n    },\n\n    /**\n     * Insert a rule into the style sheet\n     */\n    insert(cssText: string, groupValue: number) {\n      const group = Number(groupValue);\n\n      // Create a new group.\n      if (groups[group] == null) {\n        const markerRule = encodeGroupRule(group);\n        // Create the internal record.\n        groups[group] = { start: null, rules: [markerRule] };\n        // Update CSSOM.\n        if (sheet != null) {\n          sheetInsert(sheet, group, markerRule);\n        }\n      }\n\n      // selectorText is more reliable than cssText for insertion checks. The\n      // browser excludes vendor-prefixed properties and rewrites certain values\n      // making cssText more likely to be different from what was inserted.\n      const selectorText = getSelectorText(cssText);\n      if (selectorText != null && selectors[selectorText] == null) {\n        // Update the internal records.\n        selectors[selectorText] = true;\n        groups[group].rules.push(cssText);\n        // Update CSSOM.\n        if (sheet != null) {\n          const isInserted = sheetInsert(sheet, group, cssText);\n          if (!isInserted) {\n            // Revert internal record change if a rule was rejected (e.g.,\n            // unrecognized pseudo-selector)\n            groups[group].rules.pop();\n          }\n        }\n      }\n    }\n  };\n\n  return OrderedCSSStyleSheet;\n}\n\n/**\n * Helper functions\n */\n\nfunction encodeGroupRule(group) {\n  return `[stylesheet-group=\"${group}\"]{}`;\n}\n\nconst groupPattern = /[\"']/g;\nfunction decodeGroupRule(cssRule) {\n  return Number(cssRule.selectorText.split(groupPattern)[1]);\n}\n\nfunction getOrderedGroups(obj: { [key: number]: any }) {\n  return Object.keys(obj)\n    .map(Number)\n    .sort((a, b) => (a > b ? 1 : -1));\n}\n\nconst selectorPattern = /\\s*([,])\\s*/g;\nfunction getSelectorText(cssText) {\n  const selector = cssText.split('{')[0].trim();\n  return selector !== '' ? selector.replace(selectorPattern, '$1') : null;\n}\n\nfunction insertRuleAt(root, cssText: string, position: number): boolean {\n  try {\n    // $FlowFixMe: Flow is missing CSSOM types needed to type 'root'.\n    root.insertRule(cssText, position);\n    return true;\n  } catch (e) {\n    // JSDOM doesn't support `CSSSMediaRule#insertRule`.\n    // Also ignore errors that occur from attempting to insert vendor-prefixed selectors.\n    return false;\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/dom/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow strict-local\n */\n\nimport type { OrderedCSSStyleSheet } from './createOrderedCSSStyleSheet';\nimport canUseDOM from '../../../modules/canUseDom';\nimport createCSSStyleSheet from './createCSSStyleSheet';\nimport createOrderedCSSStyleSheet from './createOrderedCSSStyleSheet';\n\ntype Sheet = {\n  ...OrderedCSSStyleSheet,\n  id: string\n};\n\nconst defaultId = 'react-native-stylesheet';\nconst roots = new WeakMap<Node, number>();\nconst sheets = [];\n\nconst initialRules = [\n  // minimal top-level reset\n  'html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}',\n  'body{margin:0;}',\n  // minimal form pseudo-element reset\n  'button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}',\n  'input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}'\n];\n\nexport function createSheet(\n  root?: HTMLElement,\n  id?: string = defaultId\n): Sheet {\n  let sheet;\n\n  if (canUseDOM) {\n    const rootNode: Node = root != null ? root.getRootNode() : document;\n    // Create the initial style sheet\n    if (sheets.length === 0) {\n      sheet = createOrderedCSSStyleSheet(createCSSStyleSheet(id));\n      initialRules.forEach((rule) => {\n        sheet.insert(rule, 0);\n      });\n      roots.set(rootNode, sheets.length);\n      sheets.push(sheet);\n    } else {\n      const index = roots.get(rootNode);\n      if (index == null) {\n        const initialSheet = sheets[0];\n        // If we're creating a new sheet, populate it with existing styles\n        const textContent =\n          initialSheet != null ? initialSheet.getTextContent() : '';\n        // Cast rootNode to 'any' because Flow types for getRootNode are wrong\n        sheet = createOrderedCSSStyleSheet(\n          createCSSStyleSheet(id, (rootNode: any), textContent)\n        );\n        roots.set(rootNode, sheets.length);\n        sheets.push(sheet);\n      } else {\n        sheet = sheets[index];\n      }\n    }\n  } else {\n    // Create the initial style sheet\n    if (sheets.length === 0) {\n      sheet = createOrderedCSSStyleSheet(createCSSStyleSheet(id));\n      initialRules.forEach((rule) => {\n        sheet.insert(rule, 0);\n      });\n      sheets.push(sheet);\n    } else {\n      sheet = sheets[0];\n    }\n  }\n\n  return {\n    getTextContent() {\n      return sheet.getTextContent();\n    },\n    id,\n    insert(cssText: string, groupValue: number) {\n      sheets.forEach((s) => {\n        s.insert(cssText, groupValue);\n      });\n    }\n  };\n}\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nimport { atomic, classic, inline } from './compiler';\nimport { createSheet } from './dom';\nimport { localizeStyle } from 'styleq/transform-localize-style';\nimport { preprocess } from './preprocess';\nimport { styleq } from 'styleq';\nimport { validate } from './validate';\nimport canUseDOM from '../../modules/canUseDom';\n\nconst staticStyleMap: WeakMap<Object, Object> = new WeakMap();\nconst sheet = createSheet();\n\nconst defaultPreprocessOptions = { shadow: true, textShadow: true };\n\nfunction customStyleq(styles, options: Options = {}) {\n  const { writingDirection, ...preprocessOptions } = options;\n  const isRTL = writingDirection === 'rtl';\n  return styleq.factory({\n    transform(style) {\n      const compiledStyle = staticStyleMap.get(style);\n      if (compiledStyle != null) {\n        return localizeStyle(compiledStyle, isRTL);\n      }\n      return preprocess(style, {\n        ...defaultPreprocessOptions,\n        ...preprocessOptions\n      });\n    }\n  })(styles);\n}\n\nfunction insertRules(compiledOrderedRules) {\n  compiledOrderedRules.forEach(([rules, order]) => {\n    if (sheet != null) {\n      rules.forEach((rule) => {\n        sheet.insert(rule, order);\n      });\n    }\n  });\n}\n\nfunction compileAndInsertAtomic(style) {\n  const [compiledStyle, compiledOrderedRules] = atomic(\n    preprocess(style, defaultPreprocessOptions)\n  );\n  insertRules(compiledOrderedRules);\n  return compiledStyle;\n}\n\nfunction compileAndInsertReset(style, key) {\n  const [compiledStyle, compiledOrderedRules] = classic(style, key);\n  insertRules(compiledOrderedRules);\n  return compiledStyle;\n}\n\n/* ----- API ----- */\n\nconst absoluteFillObject = {\n  position: 'absolute',\n  left: 0,\n  right: 0,\n  top: 0,\n  bottom: 0\n};\n\nconst absoluteFill = create({ x: { ...absoluteFillObject } }).x;\n\n/**\n * create\n */\nfunction create<T: Object>(styles: T): $ReadOnly<T> {\n  Object.keys(styles).forEach((key) => {\n    const styleObj = styles[key];\n    // Only compile at runtime if the style is not already compiled\n    if (styleObj != null && styleObj.$$css !== true) {\n      let compiledStyles;\n      if (key.indexOf('$raw') > -1) {\n        compiledStyles = compileAndInsertReset(styleObj, key.split('$raw')[0]);\n      } else {\n        if (process.env.NODE_ENV !== 'production') {\n          validate(styleObj);\n          styles[key] = Object.freeze(styleObj);\n        }\n        compiledStyles = compileAndInsertAtomic(styleObj);\n      }\n      staticStyleMap.set(styleObj, compiledStyles);\n    }\n  });\n  return styles;\n}\n\n/**\n * compose\n */\nfunction compose(style1: any, style2: any): any {\n  if (process.env.NODE_ENV !== 'production') {\n    /* eslint-disable prefer-rest-params */\n    const len = arguments.length;\n    if (len > 2) {\n      const readableStyles = [...arguments].map((a) => flatten(a));\n      throw new Error(\n        `StyleSheet.compose() only accepts 2 arguments, received ${len}: ${JSON.stringify(\n          readableStyles\n        )}`\n      );\n    }\n    /* eslint-enable prefer-rest-params */\n    /*\n    console.warn(\n      'StyleSheet.compose(a, b) is deprecated; use array syntax, i.e., [a,b].'\n    );\n    */\n  }\n  return [style1, style2];\n}\n\n/**\n * flatten\n */\nfunction flatten(...styles: any): { [key: string]: any } {\n  const flatArray = styles.flat(Infinity);\n  const result = {};\n  for (let i = 0; i < flatArray.length; i++) {\n    const style = flatArray[i];\n    if (style != null && typeof style === 'object') {\n      // $FlowFixMe\n      Object.assign(result, style);\n    }\n  }\n  return result;\n}\n\n/**\n * getSheet\n */\nfunction getSheet(): { id: string, textContent: string } {\n  return {\n    id: sheet.id,\n    textContent: sheet.getTextContent()\n  };\n}\n\n/**\n * resolve\n */\ntype StyleProps = [string, { [key: string]: mixed } | null];\ntype Options = {\n  shadow?: boolean,\n  textShadow?: boolean,\n  writingDirection: 'ltr' | 'rtl'\n};\n\nfunction StyleSheet(styles: any, options?: Options = {}): StyleProps {\n  const isRTL = options.writingDirection === 'rtl';\n  const styleProps: StyleProps = customStyleq(styles, options);\n  if (Array.isArray(styleProps) && styleProps[1] != null) {\n    styleProps[1] = inline(styleProps[1], isRTL);\n  }\n  return styleProps;\n}\n\nStyleSheet.absoluteFill = absoluteFill;\nStyleSheet.absoluteFillObject = absoluteFillObject;\nStyleSheet.create = create;\nStyleSheet.compose = compose;\nStyleSheet.flatten = flatten;\nStyleSheet.getSheet = getSheet;\n// `hairlineWidth` is not implemented using screen density as browsers may\n// round sub-pixel values down to `0`, causing the line not to be rendered.\nStyleSheet.hairlineWidth = 1;\n\nif (canUseDOM && window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {\n  window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle = StyleSheet.flatten;\n}\n\nexport type IStyleSheet = {\n  (styles: $ReadOnlyArray<any>, options?: Options): StyleProps,\n  absoluteFill: Object,\n  absoluteFillObject: Object,\n  create: typeof create,\n  compose: typeof compose,\n  flatten: typeof flatten,\n  getSheet: typeof getSheet,\n  hairlineWidth: number\n};\n\nconst stylesheet: IStyleSheet = StyleSheet;\n\nexport default stylesheet;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/preprocess.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nimport normalizeColor from './compiler/normalizeColor';\nimport normalizeValueWithProperty from './compiler/normalizeValueWithProperty';\nimport { warnOnce } from '../../modules/warnOnce';\n\nconst emptyObject = {};\n\n/**\n * Shadows\n */\n\nconst defaultOffset = { height: 0, width: 0 };\n\nexport const createBoxShadowValue = (style: Object): void | string => {\n  const { shadowColor, shadowOffset, shadowOpacity, shadowRadius } = style;\n  const { height, width } = shadowOffset || defaultOffset;\n  const offsetX = normalizeValueWithProperty(width);\n  const offsetY = normalizeValueWithProperty(height);\n  const blurRadius = normalizeValueWithProperty(shadowRadius || 0);\n  const color = normalizeColor(shadowColor || 'black', shadowOpacity);\n  if (\n    color != null &&\n    offsetX != null &&\n    offsetY != null &&\n    blurRadius != null\n  ) {\n    return `${offsetX} ${offsetY} ${blurRadius} ${color}`;\n  }\n};\n\nexport const createTextShadowValue = (style: Object): void | string => {\n  const { textShadowColor, textShadowOffset, textShadowRadius } = style;\n  const { height, width } = textShadowOffset || defaultOffset;\n  const radius = textShadowRadius || 0;\n  const offsetX = normalizeValueWithProperty(width);\n  const offsetY = normalizeValueWithProperty(height);\n  const blurRadius = normalizeValueWithProperty(radius);\n  const color = normalizeValueWithProperty(textShadowColor, 'textShadowColor');\n\n  if (\n    color &&\n    (height !== 0 || width !== 0 || radius !== 0) &&\n    offsetX != null &&\n    offsetY != null &&\n    blurRadius != null\n  ) {\n    return `${offsetX} ${offsetY} ${blurRadius} ${color}`;\n  }\n};\n\n// { offsetX: 1, offsetY: 2, blurRadius: 3, spreadDistance: 4, color: 'rgba(255, 0, 0)', inset: true }\n// => 'rgba(255, 0, 0) 1px 2px 3px 4px inset'\nconst mapBoxShadow = (boxShadow: Object | string): string => {\n  if (typeof boxShadow === 'string') {\n    return boxShadow;\n  }\n  const offsetX = normalizeValueWithProperty(boxShadow.offsetX) || 0;\n  const offsetY = normalizeValueWithProperty(boxShadow.offsetY) || 0;\n  const blurRadius = normalizeValueWithProperty(boxShadow.blurRadius) || 0;\n  const spreadDistance =\n    normalizeValueWithProperty(boxShadow.spreadDistance) || 0;\n  const color = normalizeColor(boxShadow.color) || 'black';\n  const position = boxShadow.inset ? 'inset ' : '';\n  return `${position}${offsetX} ${offsetY} ${blurRadius} ${spreadDistance} ${color}`;\n};\nexport const createBoxShadowArrayValue = (value: Array<Object>): string => {\n  return value.map(mapBoxShadow).join(', ');\n};\n\n// { scale: 2 } => 'scale(2)'\n// { translateX: 20 } => 'translateX(20px)'\n// { matrix: [1,2,3,4,5,6] } => 'matrix(1,2,3,4,5,6)'\nconst mapTransform = (transform: Object): string => {\n  const type = Object.keys(transform)[0];\n  const value = transform[type];\n  if (type === 'matrix' || type === 'matrix3d') {\n    return `${type}(${value.join(',')})`;\n  } else {\n    const normalizedValue = normalizeValueWithProperty(value, type);\n    return `${type}(${normalizedValue})`;\n  }\n};\nexport const createTransformValue = (value: Array<Object>): string => {\n  return value.map(mapTransform).join(' ');\n};\n\n// [2, '30%', 10] => '2px 30% 10px'\nexport const createTransformOriginValue = (\n  value: Array<number | string>\n): string => {\n  return value.map((v) => normalizeValueWithProperty(v)).join(' ');\n};\n\nconst PROPERTIES_STANDARD: { [key: string]: string } = {\n  borderBottomEndRadius: 'borderEndEndRadius',\n  borderBottomStartRadius: 'borderEndStartRadius',\n  borderTopEndRadius: 'borderStartEndRadius',\n  borderTopStartRadius: 'borderStartStartRadius',\n  borderEndColor: 'borderInlineEndColor',\n  borderEndStyle: 'borderInlineEndStyle',\n  borderEndWidth: 'borderInlineEndWidth',\n  borderStartColor: 'borderInlineStartColor',\n  borderStartStyle: 'borderInlineStartStyle',\n  borderStartWidth: 'borderInlineStartWidth',\n  end: 'insetInlineEnd',\n  marginEnd: 'marginInlineEnd',\n  marginHorizontal: 'marginInline',\n  marginStart: 'marginInlineStart',\n  marginVertical: 'marginBlock',\n  paddingEnd: 'paddingInlineEnd',\n  paddingHorizontal: 'paddingInline',\n  paddingStart: 'paddingInlineStart',\n  paddingVertical: 'paddingBlock',\n  start: 'insetInlineStart'\n};\n\nconst ignoredProps = {\n  elevation: true,\n  overlayColor: true,\n  resizeMode: true,\n  tintColor: true\n};\n\n/**\n * Preprocess styles\n */\nexport const preprocess = <T: {| [key: string]: any |}>(\n  originalStyle: T,\n  options?: { shadow?: boolean, textShadow?: boolean } = {}\n): T => {\n  const style = originalStyle || emptyObject;\n  const nextStyle = {};\n\n  // Convert shadow styles\n  if (\n    (options.shadow === true,\n    style.shadowColor != null ||\n      style.shadowOffset != null ||\n      style.shadowOpacity != null ||\n      style.shadowRadius != null)\n  ) {\n    warnOnce(\n      'shadowStyles',\n      `\"shadow*\" style props are deprecated. Use \"boxShadow\".`\n    );\n    const boxShadowValue = createBoxShadowValue(style);\n    if (boxShadowValue != null) {\n      nextStyle.boxShadow = boxShadowValue;\n    }\n  }\n\n  // Convert text shadow styles\n  if (\n    (options.textShadow === true,\n    style.textShadowColor != null ||\n      style.textShadowOffset != null ||\n      style.textShadowRadius != null)\n  ) {\n    warnOnce(\n      'textShadowStyles',\n      `\"textShadow*\" style props are deprecated. Use \"textShadow\".`\n    );\n    const textShadowValue = createTextShadowValue(style);\n    if (textShadowValue != null && nextStyle.textShadow == null) {\n      const { textShadow } = style;\n      const value = textShadow\n        ? `${textShadow}, ${textShadowValue}`\n        : textShadowValue;\n      nextStyle.textShadow = value;\n    }\n  }\n\n  for (const originalProp in style) {\n    if (\n      // Ignore some React Native styles\n      ignoredProps[originalProp] != null ||\n      originalProp === 'shadowColor' ||\n      originalProp === 'shadowOffset' ||\n      originalProp === 'shadowOpacity' ||\n      originalProp === 'shadowRadius' ||\n      originalProp === 'textShadowColor' ||\n      originalProp === 'textShadowOffset' ||\n      originalProp === 'textShadowRadius'\n    ) {\n      continue;\n    }\n\n    const originalValue = style[originalProp];\n    const prop = PROPERTIES_STANDARD[originalProp] || originalProp;\n    let value = originalValue;\n\n    if (\n      !Object.prototype.hasOwnProperty.call(style, originalProp) ||\n      (prop !== originalProp && style[prop] != null)\n    ) {\n      continue;\n    }\n\n    if (prop === 'aspectRatio' && typeof value === 'number') {\n      nextStyle[prop] = value.toString();\n    } else if (prop === 'boxShadow') {\n      if (Array.isArray(value)) {\n        value = createBoxShadowArrayValue(value);\n      }\n      const { boxShadow } = nextStyle;\n      nextStyle.boxShadow = boxShadow ? `${value}, ${boxShadow}` : value;\n    } else if (prop === 'fontVariant') {\n      if (Array.isArray(value) && value.length > 0) {\n        /*\n        warnOnce(\n          'fontVariant',\n          '\"fontVariant\" style array value is deprecated. Use space-separated values.'\n        );\n        */\n        value = value.join(' ');\n      }\n      nextStyle[prop] = value;\n    } else if (prop === 'textAlignVertical') {\n      /*\n      warnOnce(\n        'textAlignVertical',\n        '\"textAlignVertical\" style is deprecated. Use \"verticalAlign\".'\n      );\n      */\n      if (style.verticalAlign == null) {\n        nextStyle.verticalAlign = value === 'center' ? 'middle' : value;\n      }\n    } else if (prop === 'transform') {\n      if (Array.isArray(value)) {\n        value = createTransformValue(value);\n      }\n      nextStyle.transform = value;\n    } else if (prop === 'transformOrigin') {\n      if (Array.isArray(value)) {\n        value = createTransformOriginValue(value);\n      }\n      nextStyle.transformOrigin = value;\n    } else {\n      nextStyle[prop] = value;\n    }\n  }\n\n  // $FlowIgnore\n  return nextStyle;\n};\n\nexport default preprocess;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/StyleSheet/validate.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @noflow\n */\n\nimport valueParser from 'postcss-value-parser';\n\nconst invalidShortforms = {\n  background: true,\n  borderBottom: true,\n  borderLeft: true,\n  borderRight: true,\n  borderTop: true,\n  font: true,\n  grid: true,\n  outline: true,\n  textDecoration: true\n};\n\nconst invalidMultiValueShortforms = {\n  flex: true,\n  margin: true,\n  padding: true,\n  borderColor: true,\n  borderRadius: true,\n  borderStyle: true,\n  borderWidth: true,\n  inset: true,\n  insetBlock: true,\n  insetInline: true,\n  marginBlock: true,\n  marginInline: true,\n  marginHorizontal: true,\n  marginVertical: true,\n  paddingBlock: true,\n  paddingInline: true,\n  paddingHorizontal: true,\n  paddingVertical: true,\n  overflow: true,\n  overscrollBehavior: true,\n  backgroundPosition: true\n};\n\nfunction error(message) {\n  console.error(message);\n}\n\nexport function validate(obj: Object) {\n  for (const k in obj) {\n    const prop = k.trim();\n    const value = obj[prop];\n    let isInvalid = false;\n\n    if (value === null) {\n      continue;\n    }\n\n    if (typeof value === 'string' && value.indexOf('!important') > -1) {\n      error(\n        `Invalid style declaration \"${prop}:${value}\". Values cannot include \"!important\"`\n      );\n      isInvalid = true;\n    } else {\n      let suggestion = '';\n      if (prop === 'animation' || prop === 'animationName') {\n        suggestion = 'Did you mean \"animationKeyframes\"?';\n        isInvalid = true;\n      } else if (prop === 'direction') {\n        suggestion = 'Did you mean \"writingDirection\"?';\n        isInvalid = true;\n      } else if (invalidShortforms[prop]) {\n        suggestion = 'Please use long-form properties.';\n        isInvalid = true;\n      } else if (invalidMultiValueShortforms[prop]) {\n        if (typeof value === 'string' && valueParser(value).nodes.length > 1) {\n          suggestion = `Value is \"${value}\" but only single values are supported.`;\n          isInvalid = true;\n        }\n      }\n      if (suggestion !== '') {\n        error(`Invalid style property of \"${prop}\". ${suggestion}`);\n      }\n    }\n\n    if (isInvalid) {\n      delete obj[k];\n    }\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Switch/__tests__/__snapshots__/index-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`components/Switch disabled when \"true\" and value=\"false\", a disabled checkbox is rendered with provided false value of trackColor 1`] = `\n<div\n  class=\"css-view-g5y9jx r-bottom-1p0dtai r-forcedColorAdjust-1c6unfx r-height-1dernwh r-left-1d2f490 r-margin-ywje51 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-transitionDuration-13tjlyg r-width-13qz1uu\"\n  style=\"background-color: rgb(29, 161, 242); border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px;\"\n/>\n`;\n\nexports[`components/Switch disabled when \"true\" and value=\"false\", a disabled checkbox is rendered with provided thumbColor 1`] = `\n<div\n  class=\"css-view-g5y9jx r-alignSelf-k200y r-borderRadius-1j16mh1 r-boxShadow-1ewcgjf r-forcedColorAdjust-1c6unfx r-insetInlineStart-10s2tm5 r-transform-agouwx r-transitionDuration-13tjlyg\"\n  style=\"background-color: rgb(255, 255, 255); height: 20px; margin-left: 0px; width: 20px;\"\n/>\n`;\n\nexports[`components/Switch disabled when \"true\" and value=\"false\", a disabled checkbox is rendered with provided trackColor 1`] = `\n<div\n  class=\"css-view-g5y9jx r-bottom-1p0dtai r-forcedColorAdjust-1c6unfx r-height-1dernwh r-left-1d2f490 r-margin-ywje51 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-transitionDuration-13tjlyg r-width-13qz1uu\"\n  style=\"background-color: rgb(224, 36, 94); border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px;\"\n/>\n`;\n\nexports[`components/Switch disabled when \"true\" and value=\"true\", a disabled checkbox is rendered with provided activeThumbColor 1`] = `\n<div\n  class=\"css-view-g5y9jx r-alignSelf-k200y r-borderRadius-1j16mh1 r-boxShadow-1ewcgjf r-forcedColorAdjust-1c6unfx r-transform-agouwx r-transitionDuration-13tjlyg r-insetInlineStart-rci37q\"\n  style=\"background-color: rgb(255, 255, 255); height: 20px; margin-left: -20px; width: 20px;\"\n/>\n`;\n\nexports[`components/Switch disabled when \"true\" and value=\"true\", a disabled checkbox is rendered with provided activeTrackColor 1`] = `\n<div\n  class=\"css-view-g5y9jx r-bottom-1p0dtai r-forcedColorAdjust-1c6unfx r-height-1dernwh r-left-1d2f490 r-margin-ywje51 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-transitionDuration-13tjlyg r-width-13qz1uu\"\n  style=\"background-color: rgb(224, 36, 94); border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px;\"\n/>\n`;\n\nexports[`components/Switch disabled when \"true\" and value=\"true\", a disabled checkbox is rendered with provided true value of trackColor 1`] = `\n<div\n  class=\"css-view-g5y9jx r-bottom-1p0dtai r-forcedColorAdjust-1c6unfx r-height-1dernwh r-left-1d2f490 r-margin-ywje51 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-transitionDuration-13tjlyg r-width-13qz1uu\"\n  style=\"background-color: rgb(224, 36, 94); border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px;\"\n/>\n`;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Switch/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport React from 'react';\nimport { render } from '@testing-library/react';\nimport Switch from '..';\n\nfunction findCheckbox(container) {\n  return container.firstChild.querySelector('input');\n}\n\nfunction findSwitchTrack(container) {\n  return container.firstChild.querySelector('div');\n}\n\nfunction findSwitchThumb(container) {\n  return container.firstChild.childNodes[1];\n}\n\ndescribe('components/Switch', () => {\n  test('accessibilityLabel is applied to native checkbox', () => {\n    const { container } = render(<Switch aria-label=\"switch\" />);\n    expect(findCheckbox(container).getAttribute('aria-label')).toBe('switch');\n  });\n\n  describe('disabled', () => {\n    test('when \"false\" a default checkbox is rendered', () => {\n      const { container } = render(<Switch />);\n      expect(findCheckbox(container).disabled).toBe(false);\n    });\n\n    test('when \"true\" a disabled checkbox is rendered', () => {\n      const { container } = render(<Switch disabled />);\n      expect(findCheckbox(container).disabled).toBe(true);\n    });\n\n    test('when \"true\" and value=\"true\", a disabled checkbox is rendered with provided activeTrackColor', () => {\n      const { container } = render(\n        <Switch activeTrackColor=\"#E0245E\" disabled value={true} />\n      );\n      expect(findSwitchTrack(container)).toMatchSnapshot();\n    });\n\n    test('when \"true\" and value=\"true\", a disabled checkbox is rendered with provided activeThumbColor', () => {\n      const { container } = render(\n        <Switch activeThumbColor=\"#fff\" disabled value={true} />\n      );\n      expect(findSwitchThumb(container)).toMatchSnapshot();\n    });\n\n    test('when \"true\" and value=\"false\", a disabled checkbox is rendered with provided trackColor', () => {\n      const { container } = render(\n        <Switch disabled trackColor=\"#E0245E\" value={false} />\n      );\n      expect(findSwitchTrack(container)).toMatchSnapshot();\n    });\n\n    test('when \"true\" and value=\"false\", a disabled checkbox is rendered with provided thumbColor', () => {\n      const { container } = render(\n        <Switch disabled thumbColor=\"#fff\" value={false} />\n      );\n      expect(findSwitchThumb(container)).toMatchSnapshot();\n    });\n\n    test('when \"true\" and value=\"true\", a disabled checkbox is rendered with provided true value of trackColor', () => {\n      const { container } = render(\n        <Switch\n          disabled={true}\n          trackColor={{ true: '#E0245E', false: '#1DA1F2' }}\n          value={true}\n        />\n      );\n      expect(findSwitchTrack(container)).toMatchSnapshot();\n    });\n\n    test('when \"true\" and value=\"false\", a disabled checkbox is rendered with provided false value of trackColor', () => {\n      const { container } = render(\n        <Switch\n          disabled={true}\n          trackColor={{ true: '#E0245E', false: '#1DA1F2' }}\n          value={false}\n        />\n      );\n      expect(findSwitchTrack(container)).toMatchSnapshot();\n    });\n  });\n\n  describe('onValueChange', () => {\n    test('when value is \"false\" it receives \"true\"', () => {\n      const onValueChange = jest.fn();\n      const { container } = render(\n        <Switch onValueChange={onValueChange} value={false} />\n      );\n      const checkbox = findCheckbox(container);\n      checkbox.click(); // Needed to get ReactDOM to trigger 'change' event\n      expect(onValueChange).toHaveBeenCalledWith(true);\n    });\n\n    test('when value is \"true\" it receives \"false\"', () => {\n      const onValueChange = jest.fn();\n      const { container } = render(\n        <Switch onValueChange={onValueChange} value />\n      );\n      const checkbox = findCheckbox(container);\n      checkbox.click(); // Needed to get ReactDOM to trigger 'change' event\n      expect(onValueChange).toHaveBeenCalledWith(false);\n    });\n  });\n\n  describe('value', () => {\n    test('when \"false\" an unchecked checkbox is rendered', () => {\n      const { container } = render(<Switch value={false} />);\n      expect(findCheckbox(container).checked).toBe(false);\n    });\n\n    test('when \"true\" a checked checkbox is rendered', () => {\n      const { container } = render(<Switch value />);\n      expect(findCheckbox(container).checked).toBe(true);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Switch/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\n'use client';\n\nimport type { ColorValue } from '../../types';\nimport type { ViewProps } from '../View';\n\nimport * as React from 'react';\nimport createElement from '../createElement';\nimport multiplyStyleLengthValue from '../../modules/multiplyStyleLengthValue';\nimport StyleSheet from '../StyleSheet';\nimport View from '../View';\n\ntype SwitchProps = {\n  ...ViewProps,\n  activeThumbColor?: ColorValue,\n  activeTrackColor?: ColorValue,\n  disabled?: boolean,\n  onValueChange?: (e: any) => void,\n  thumbColor?: ColorValue,\n  trackColor?: ColorValue | {| false: ColorValue, true: ColorValue |},\n  value?: boolean\n};\n\nconst emptyObject = {};\nconst thumbDefaultBoxShadow = '0px 1px 3px rgba(0,0,0,0.5)';\nconst thumbFocusedBoxShadow = `${thumbDefaultBoxShadow}, 0 0 0 10px rgba(0,0,0,0.1)`;\n\nconst defaultActiveTrackColor = '#A3D3CF';\nconst defaultTrackColor = '#939393';\nconst defaultDisabledTrackColor = '#D5D5D5';\n\nconst defaultActiveThumbColor = '#009688';\nconst defaultThumbColor = '#FAFAFA';\nconst defaultDisabledThumbColor = '#BDBDBD';\n\nconst Switch: React.AbstractComponent<\n  SwitchProps,\n  React.ElementRef<typeof View>\n> = React.forwardRef((props, forwardedRef) => {\n  const {\n    'aria-label': ariaLabel,\n    accessibilityLabel,\n    activeThumbColor,\n    activeTrackColor,\n    disabled = false,\n    onValueChange,\n    style = emptyObject,\n    thumbColor,\n    trackColor,\n    value = false,\n    ...other\n  } = props;\n\n  const thumbRef = React.useRef(null);\n\n  function handleChange(event: Object) {\n    if (onValueChange != null) {\n      onValueChange(event.nativeEvent.target.checked);\n    }\n  }\n\n  function handleFocusState(event: Object) {\n    const isFocused = event.nativeEvent.type === 'focus';\n    const boxShadow = isFocused ? thumbFocusedBoxShadow : thumbDefaultBoxShadow;\n    if (thumbRef.current != null) {\n      thumbRef.current.style.boxShadow = boxShadow;\n    }\n  }\n\n  const { height: styleHeight, width: styleWidth } = StyleSheet.flatten(style);\n  const height = styleHeight || '20px';\n  const minWidth = multiplyStyleLengthValue(height, 2);\n  const width = styleWidth > minWidth ? styleWidth : minWidth;\n  const trackBorderRadius = multiplyStyleLengthValue(height, 0.5);\n\n  const trackCurrentColor = (function () {\n    if (value === true) {\n      if (trackColor != null && typeof trackColor === 'object') {\n        return trackColor.true;\n      } else {\n        return activeTrackColor ?? defaultActiveTrackColor;\n      }\n    } else {\n      if (trackColor != null && typeof trackColor === 'object') {\n        return trackColor.false;\n      } else {\n        return trackColor ?? defaultTrackColor;\n      }\n    }\n  })();\n\n  const thumbCurrentColor = value\n    ? activeThumbColor ?? defaultActiveThumbColor\n    : thumbColor ?? defaultThumbColor;\n\n  const thumbHeight = height;\n  const thumbWidth = thumbHeight;\n\n  const rootStyle = [\n    styles.root,\n    style,\n    disabled && styles.cursorDefault,\n    { height, width }\n  ];\n\n  const disabledTrackColor = (function () {\n    if (value === true) {\n      if (\n        (typeof activeTrackColor === 'string' && activeTrackColor != null) ||\n        (typeof trackColor === 'object' && trackColor?.true)\n      ) {\n        return trackCurrentColor;\n      } else {\n        return defaultDisabledTrackColor;\n      }\n    } else {\n      if (\n        (typeof trackColor === 'string' && trackColor != null) ||\n        (typeof trackColor === 'object' && trackColor?.false)\n      ) {\n        return trackCurrentColor;\n      } else {\n        return defaultDisabledTrackColor;\n      }\n    }\n  })();\n\n  const disabledThumbColor = (function () {\n    if (value === true) {\n      if (activeThumbColor == null) {\n        return defaultDisabledThumbColor;\n      } else {\n        return thumbCurrentColor;\n      }\n    } else {\n      if (thumbColor == null) {\n        return defaultDisabledThumbColor;\n      } else {\n        return thumbCurrentColor;\n      }\n    }\n  })();\n\n  const trackStyle = [\n    styles.track,\n    {\n      backgroundColor: disabled ? disabledTrackColor : trackCurrentColor,\n      borderRadius: trackBorderRadius\n    }\n  ];\n\n  const thumbStyle = [\n    styles.thumb,\n    value && styles.thumbActive,\n    {\n      backgroundColor: disabled ? disabledThumbColor : thumbCurrentColor,\n      height: thumbHeight,\n      marginStart: value ? multiplyStyleLengthValue(thumbWidth, -1) : 0,\n      width: thumbWidth\n    }\n  ];\n\n  const nativeControl = createElement('input', {\n    'aria-label': ariaLabel || accessibilityLabel,\n    checked: value,\n    disabled: disabled,\n    onBlur: handleFocusState,\n    onChange: handleChange,\n    onFocus: handleFocusState,\n    ref: forwardedRef,\n    style: [styles.nativeControl, styles.cursorInherit],\n    type: 'checkbox',\n    role: 'switch'\n  });\n\n  return (\n    <View {...other} style={rootStyle}>\n      <View style={trackStyle} />\n      <View ref={thumbRef} style={thumbStyle} />\n      {nativeControl}\n    </View>\n  );\n});\n\nSwitch.displayName = 'Switch';\n\nconst styles = StyleSheet.create({\n  root: {\n    cursor: 'pointer',\n    userSelect: 'none'\n  },\n  cursorDefault: {\n    cursor: 'default'\n  },\n  cursorInherit: {\n    cursor: 'inherit'\n  },\n  track: {\n    forcedColorAdjust: 'none',\n    ...StyleSheet.absoluteFillObject,\n    height: '70%',\n    margin: 'auto',\n    transitionDuration: '0.1s',\n    width: '100%'\n  },\n  thumb: {\n    forcedColorAdjust: 'none',\n    alignSelf: 'flex-start',\n    borderRadius: '100%',\n    boxShadow: thumbDefaultBoxShadow,\n    start: '0%',\n    transform: 'translateZ(0)',\n    transitionDuration: '0.1s'\n  },\n  thumbActive: {\n    insetInlineStart: '100%'\n  },\n  nativeControl: {\n    ...StyleSheet.absoluteFillObject,\n    height: '100%',\n    margin: 0,\n    appearance: 'none',\n    padding: 0,\n    width: '100%'\n  }\n});\n\nexport default Switch;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Text/TextAncestorContext.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict\n */\n\n'use client';\n\nimport type { Context } from 'react';\n\nimport { createContext } from 'react';\n\nconst TextAncestorContext = createContext(false);\nexport default (TextAncestorContext: Context<boolean>);\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Text/__tests__/__snapshots__/index-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`components/Text default 1`] = `\n<div\n  class=\"css-text-146c3p1\"\n  dir=\"auto\"\n/>\n`;\n\nexports[`components/Text nested 1`] = `\n<div\n  class=\"css-text-146c3p1\"\n  dir=\"auto\"\n>\n  <span\n    class=\"css-textHasAncestor-1jxf684\"\n    data-testid=\"child\"\n  />\n</div>\n`;\n\nexports[`components/Text prop \"aria-label\" value is set 1`] = `\n<div\n  aria-label=\"accessibility label\"\n  class=\"css-text-146c3p1\"\n  dir=\"auto\"\n/>\n`;\n\nexports[`components/Text prop \"aria-labelledby\" value is set 1`] = `\n<div\n  aria-labelledby=\"123\"\n  class=\"css-text-146c3p1\"\n  dir=\"auto\"\n/>\n`;\n\nexports[`components/Text prop \"aria-live\" value is set 1`] = `\n<div\n  aria-live=\"polite\"\n  class=\"css-text-146c3p1\"\n  dir=\"auto\"\n/>\n`;\n\nexports[`components/Text prop \"dir\" value is \"ltr\" 1`] = `\n<div\n  class=\"css-text-146c3p1\"\n  dir=\"ltr\"\n/>\n`;\n\nexports[`components/Text prop \"dir\" value is \"rtl\" 1`] = `\n<div\n  class=\"css-text-146c3p1\"\n  dir=\"rtl\"\n/>\n`;\n\nexports[`components/Text prop \"href\" href with accessibilityRole 1`] = `\n<a\n  class=\"css-text-146c3p1\"\n  dir=\"auto\"\n  href=\"https://example.com\"\n  role=\"presentation\"\n/>\n`;\n\nexports[`components/Text prop \"href\" value is set 1`] = `\n<a\n  class=\"css-text-146c3p1\"\n  dir=\"auto\"\n  href=\"https://example.com\"\n/>\n`;\n\nexports[`components/Text prop \"hrefAttrs\" null values are excluded 1`] = `\n<a\n  class=\"css-text-146c3p1\"\n  dir=\"auto\"\n  href=\"https://example.com\"\n/>\n`;\n\nexports[`components/Text prop \"hrefAttrs\" requires \"href\" 1`] = `\n<div\n  class=\"css-text-146c3p1\"\n  dir=\"auto\"\n/>\n`;\n\nexports[`components/Text prop \"hrefAttrs\" target variant is set 1`] = `\n<a\n  class=\"css-text-146c3p1\"\n  dir=\"auto\"\n  href=\"https://example.com\"\n  target=\"_blank\"\n/>\n`;\n\nexports[`components/Text prop \"hrefAttrs\" value is set 1`] = `\n<a\n  class=\"css-text-146c3p1\"\n  dir=\"auto\"\n  download=\"filename.jpg\"\n  href=\"https://example.com\"\n  rel=\"nofollow\"\n  target=\"_blank\"\n/>\n`;\n\nexports[`components/Text prop \"lang\" ar 1`] = `\n<div\n  class=\"css-text-146c3p1\"\n  dir=\"rtl\"\n  lang=\"ar\"\n/>\n`;\n\nexports[`components/Text prop \"lang\" fr 1`] = `\n<div\n  class=\"css-text-146c3p1\"\n  dir=\"ltr\"\n  lang=\"fr\"\n/>\n`;\n\nexports[`components/Text prop \"lang\" undefined 1`] = `\n<div\n  class=\"css-text-146c3p1\"\n  dir=\"auto\"\n/>\n`;\n\nexports[`components/Text prop \"lang\" with dir 1`] = `\n<div\n  class=\"css-text-146c3p1\"\n  dir=\"ltr\"\n  lang=\"ar\"\n/>\n`;\n\nexports[`components/Text prop \"nativeID\" value is set 1`] = `\n<div\n  class=\"css-text-146c3p1\"\n  dir=\"auto\"\n  id=\"nativeID\"\n/>\n`;\n\nexports[`components/Text prop \"numberOfLines\" value is set 1`] = `\n<div\n  class=\"css-text-146c3p1 r-WebkitBoxOrient-8akbws r-display-krxsd3 r-maxWidth-dnmrzs r-overflow-1qsk4np r-textOverflow-1udbk01\"\n  dir=\"auto\"\n/>\n`;\n\nexports[`components/Text prop \"numberOfLines\" value is set to one 1`] = `\n<div\n  class=\"css-text-146c3p1 r-maxWidth-dnmrzs r-overflow-1udh08x r-textOverflow-1udbk01 r-whiteSpace-3s2u2q r-wordWrap-1iln25a\"\n  dir=\"auto\"\n/>\n`;\n\nexports[`components/Text prop \"role\" value alters HTML element 1`] = `\n<article\n  class=\"css-text-146c3p1\"\n  dir=\"auto\"\n  role=\"article\"\n/>\n`;\n\nexports[`components/Text prop \"role\" value is \"button\" 1`] = `\n<button\n  class=\"css-text-146c3p1\"\n  dir=\"auto\"\n  role=\"button\"\n  type=\"button\"\n/>\n`;\n\nexports[`components/Text prop \"role\" value is set 1`] = `\n<div\n  class=\"css-text-146c3p1\"\n  dir=\"auto\"\n  role=\"presentation\"\n/>\n`;\n\nexports[`components/Text prop \"selectable\" value of false 1`] = `\n<div\n  class=\"css-text-146c3p1 r-userSelect-lrvibr\"\n  dir=\"auto\"\n/>\n`;\n\nexports[`components/Text prop \"selectable\" value of true 1`] = `\n<div\n  class=\"css-text-146c3p1 r-userSelect-1xnzce8\"\n  dir=\"auto\"\n/>\n`;\n\nexports[`components/Text prop \"style\" value is set 1`] = `\n<div\n  class=\"css-text-146c3p1\"\n  dir=\"auto\"\n  style=\"border-top-width: 5px; border-right-width: 5px; border-bottom-width: 5px; border-left-width: 5px;\"\n/>\n`;\n\nexports[`components/Text prop \"testID\" value is set 1`] = `\n<div\n  class=\"css-text-146c3p1\"\n  data-testid=\"123\"\n  dir=\"auto\"\n/>\n`;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Text/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/* eslint-disable react/jsx-no-bind */\n\nimport React from 'react';\nimport Text from '../';\nimport { createEventTarget, setPointerEvent } from 'dom-event-testing-library';\nimport { act, render } from '@testing-library/react';\n\ndescribe('components/Text', () => {\n  test('default', () => {\n    const { container } = render(<Text />);\n    expect(container.firstChild).toMatchSnapshot();\n  });\n\n  test('nested', () => {\n    const { container } = render(<Text children={<Text testID=\"child\" />} />);\n    expect(container.firstChild).toMatchSnapshot();\n  });\n\n  describe('prop \"aria-label\"', () => {\n    test('value is set', () => {\n      const { container } = render(<Text aria-label=\"accessibility label\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"aria-labelledby\"', () => {\n    test('value is set', () => {\n      const { container } = render(<Text aria-labelledby=\"123\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"aria-live\"', () => {\n    test('value is set', () => {\n      const { container } = render(<Text aria-live=\"polite\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"role\"', () => {\n    test('value is set', () => {\n      const { container } = render(<Text role=\"none\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('value is \"button\"', () => {\n      const { container } = render(<Text role=\"button\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('value alters HTML element', () => {\n      const { container } = render(<Text role=\"article\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"dir\"', () => {\n    test('value is \"ltr\"', () => {\n      const { container } = render(<Text dir=\"ltr\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('value is \"rtl\"', () => {\n      const { container } = render(<Text dir=\"rtl\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"href\"', () => {\n    test('value is set', () => {\n      const { container } = render(<Text href=\"https://example.com\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('href with accessibilityRole', () => {\n      const { container } = render(\n        <Text accessibilityRole=\"none\" href=\"https://example.com\" />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"hrefAttrs\"', () => {\n    test('requires \"href\"', () => {\n      const { container } = render(\n        <Text hrefAttrs={{ download: 'filename.jpg' }} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('value is set', () => {\n      const hrefAttrs = {\n        download: 'filename.jpg',\n        rel: 'nofollow',\n        target: '_blank'\n      };\n      const { container } = render(\n        <Text href=\"https://example.com\" hrefAttrs={hrefAttrs} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('target variant is set', () => {\n      const hrefAttrs = {\n        target: 'blank'\n      };\n      const { container } = render(\n        <Text href=\"https://example.com\" hrefAttrs={hrefAttrs} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('null values are excluded', () => {\n      const hrefAttrs = {\n        download: null,\n        rel: null,\n        target: null\n      };\n      const { container } = render(\n        <Text href=\"https://example.com\" hrefAttrs={hrefAttrs} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"lang\"', () => {\n    test('undefined', () => {\n      const { container } = render(<Text />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('fr', () => {\n      const { container } = render(<Text lang=\"fr\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('ar', () => {\n      const { container } = render(<Text lang=\"ar\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('with dir', () => {\n      const { container } = render(<Text dir=\"ltr\" lang=\"ar\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"nativeID\"', () => {\n    test('value is set', () => {\n      const { container } = render(<Text nativeID=\"nativeID\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"numberOfLines\"', () => {\n    test('value is set', () => {\n      const { container } = render(<Text numberOfLines={3} />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n    test('value is set to one', () => {\n      const { container } = render(<Text numberOfLines={1} />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"onBlur\"', () => {\n    test('is called', () => {\n      const onBlur = jest.fn();\n      const ref = React.createRef();\n      act(() => {\n        render(<Text onBlur={onBlur} ref={ref} />);\n      });\n      const target = createEventTarget(ref.current);\n      const body = createEventTarget(document.body);\n      act(() => {\n        target.focus();\n        body.focus({ relatedTarget: target.node });\n      });\n      expect(onBlur).toBeCalled();\n    });\n  });\n\n  describe('prop \"onClick\"', () => {\n    test('is called', () => {\n      const onClick = jest.fn();\n      const ref = React.createRef();\n      act(() => {\n        render(<Text onClick={onClick} ref={ref} />);\n      });\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.click();\n      });\n      expect(onClick).toBeCalled();\n    });\n\n    test('is still called if \"onPress\" is provided', () => {\n      const onClick = jest.fn();\n      const ref = React.createRef();\n      act(() => {\n        render(<Text onClick={onClick} onPress={() => {}} ref={ref} />);\n      });\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.click();\n      });\n      expect(onClick).toBeCalled();\n    });\n  });\n\n  describe('prop \"onFocus\"', () => {\n    test('is called', () => {\n      const onFocus = jest.fn();\n      const ref = React.createRef();\n      act(() => {\n        render(<Text onFocus={onFocus} ref={ref} />);\n      });\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.focus();\n      });\n      expect(onFocus).toBeCalled();\n    });\n  });\n\n  describe('prop \"onPointerDown\"', () => {\n    beforeEach(() => {\n      setPointerEvent(true);\n    });\n    afterEach(() => {\n      setPointerEvent(false);\n    });\n\n    test('is called', () => {\n      const onPointerDown = jest.fn();\n      const ref = React.createRef();\n      act(() => {\n        render(<Text onPointerDown={onPointerDown} ref={ref} />);\n      });\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.pointerdown({ pointerType: 'touch' });\n      });\n      expect(onPointerDown).toBeCalled();\n    });\n  });\n\n  describe('prop \"onPress\"', () => {\n    test('is called', () => {\n      const onPress = jest.fn();\n      const ref = React.createRef();\n      act(() => {\n        render(<Text onPress={onPress} ref={ref} />);\n      });\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.pointerdown({ button: 0 });\n        target.pointerup({ button: 0 });\n      });\n      expect(onPress).toBeCalled();\n    });\n\n    test('is not called if \"onClick\" is provided', () => {\n      const onPress = jest.fn();\n      const ref = React.createRef();\n      act(() => {\n        render(<Text onClick={() => {}} onPress={onPress} ref={ref} />);\n      });\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.click();\n      });\n      expect(onPress).not.toBeCalled();\n    });\n  });\n\n  describe('prop \"ref\"', () => {\n    test('value is set', () => {\n      const ref = jest.fn();\n      render(<Text ref={ref} />);\n      expect(ref).toBeCalled();\n    });\n\n    test('is not called for prop changes', () => {\n      const ref = jest.fn();\n      let rerender;\n      act(() => {\n        ({ rerender } = render(\n          <Text nativeID=\"123\" ref={ref} style={{ borderWidth: 5 }} />\n        ));\n      });\n      expect(ref).toHaveBeenCalledTimes(1);\n      act(() => {\n        rerender(<Text nativeID=\"1234\" ref={ref} style={{ borderWidth: 6 }} />);\n      });\n      expect(ref).toHaveBeenCalledTimes(1);\n    });\n\n    test('node has imperative methods', () => {\n      const ref = React.createRef();\n      act(() => {\n        render(<Text ref={ref} />);\n      });\n      const node = ref.current;\n      expect(typeof node.measure === 'function');\n      expect(typeof node.measureLayout === 'function');\n      expect(typeof node.measureInWindow === 'function');\n    });\n  });\n\n  describe('prop \"selectable\"', () => {\n    test('value of false', () => {\n      const { container } = render(<Text selectable={false} />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('value of true', () => {\n      const { container } = render(<Text selectable={true} />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"style\"', () => {\n    test('value is set', () => {\n      const { container } = render(<Text style={{ borderWidth: 5 }} />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"testID\"', () => {\n    test('value is set', () => {\n      const { container } = render(<Text testID=\"123\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Text/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use client';\n\nimport type { PlatformMethods } from '../../types';\nimport type { TextProps } from './types';\n\nimport * as React from 'react';\nimport createElement from '../createElement';\nimport * as forwardedProps from '../../modules/forwardedProps';\nimport pick from '../../modules/pick';\nimport useElementLayout from '../../modules/useElementLayout';\nimport useMergeRefs from '../../modules/useMergeRefs';\nimport usePlatformMethods from '../../modules/usePlatformMethods';\nimport useResponderEvents from '../../modules/useResponderEvents';\nimport StyleSheet from '../StyleSheet';\nimport TextAncestorContext from './TextAncestorContext';\nimport { useLocaleContext, getLocaleDirection } from '../../modules/useLocale';\n//import { warnOnce } from '../../modules/warnOnce';\n\nconst forwardPropsList = Object.assign(\n  {},\n  forwardedProps.defaultProps,\n  forwardedProps.accessibilityProps,\n  forwardedProps.clickProps,\n  forwardedProps.focusProps,\n  forwardedProps.keyboardProps,\n  forwardedProps.mouseProps,\n  forwardedProps.touchProps,\n  forwardedProps.styleProps,\n  {\n    href: true,\n    lang: true,\n    pointerEvents: true\n  }\n);\n\nconst pickProps = (props) => pick(props, forwardPropsList);\n\nconst Text: React.AbstractComponent<TextProps, HTMLElement & PlatformMethods> =\n  React.forwardRef((props, forwardedRef) => {\n    const {\n      hrefAttrs,\n      numberOfLines,\n      onClick,\n      onLayout,\n      onPress,\n      onMoveShouldSetResponder,\n      onMoveShouldSetResponderCapture,\n      onResponderEnd,\n      onResponderGrant,\n      onResponderMove,\n      onResponderReject,\n      onResponderRelease,\n      onResponderStart,\n      onResponderTerminate,\n      onResponderTerminationRequest,\n      onScrollShouldSetResponder,\n      onScrollShouldSetResponderCapture,\n      onSelectionChangeShouldSetResponder,\n      onSelectionChangeShouldSetResponderCapture,\n      onStartShouldSetResponder,\n      onStartShouldSetResponderCapture,\n      selectable,\n      ...rest\n    } = props;\n\n    /*\n    if (selectable != null) {\n      warnOnce(\n        'selectable',\n        'selectable prop is deprecated. Use styles.userSelect.'\n      );\n    }\n    */\n\n    const hasTextAncestor = React.useContext(TextAncestorContext);\n    const hostRef = React.useRef(null);\n    const { direction: contextDirection } = useLocaleContext();\n\n    useElementLayout(hostRef, onLayout);\n    useResponderEvents(hostRef, {\n      onMoveShouldSetResponder,\n      onMoveShouldSetResponderCapture,\n      onResponderEnd,\n      onResponderGrant,\n      onResponderMove,\n      onResponderReject,\n      onResponderRelease,\n      onResponderStart,\n      onResponderTerminate,\n      onResponderTerminationRequest,\n      onScrollShouldSetResponder,\n      onScrollShouldSetResponderCapture,\n      onSelectionChangeShouldSetResponder,\n      onSelectionChangeShouldSetResponderCapture,\n      onStartShouldSetResponder,\n      onStartShouldSetResponderCapture\n    });\n\n    const handleClick = React.useCallback(\n      (e) => {\n        if (onClick != null) {\n          onClick(e);\n        } else if (onPress != null) {\n          e.stopPropagation();\n          onPress(e);\n        }\n      },\n      [onClick, onPress]\n    );\n\n    let component = hasTextAncestor ? 'span' : 'div';\n\n    const langDirection =\n      props.lang != null ? getLocaleDirection(props.lang) : null;\n    const componentDirection = props.dir || langDirection;\n    const writingDirection = componentDirection || contextDirection;\n\n    const supportedProps = pickProps(rest);\n    supportedProps.dir = componentDirection;\n    // 'auto' by default allows browsers to infer writing direction (root elements only)\n    if (!hasTextAncestor) {\n      supportedProps.dir =\n        componentDirection != null ? componentDirection : 'auto';\n    }\n\n    if (onClick || onPress) {\n      supportedProps.onClick = handleClick;\n    }\n\n    supportedProps.style = [\n      numberOfLines != null &&\n        numberOfLines > 1 && { WebkitLineClamp: numberOfLines },\n      hasTextAncestor === true ? styles.textHasAncestor$raw : styles.text$raw,\n      numberOfLines === 1 && styles.textOneLine,\n      numberOfLines != null && numberOfLines > 1 && styles.textMultiLine,\n      props.style,\n      selectable === true && styles.selectable,\n      selectable === false && styles.notSelectable,\n      onPress && styles.pressable\n    ];\n\n    if (props.href != null) {\n      component = 'a';\n      if (hrefAttrs != null) {\n        const { download, rel, target } = hrefAttrs;\n        if (download != null) {\n          supportedProps.download = download;\n        }\n        if (rel != null) {\n          supportedProps.rel = rel;\n        }\n        if (typeof target === 'string') {\n          supportedProps.target =\n            target.charAt(0) !== '_' ? '_' + target : target;\n        }\n      }\n    }\n\n    const platformMethodsRef = usePlatformMethods(supportedProps);\n    const setRef = useMergeRefs(hostRef, platformMethodsRef, forwardedRef);\n\n    supportedProps.ref = setRef;\n\n    const element = createElement(component, supportedProps, {\n      writingDirection\n    });\n\n    return hasTextAncestor ? (\n      element\n    ) : (\n      <TextAncestorContext.Provider value={true}>\n        {element}\n      </TextAncestorContext.Provider>\n    );\n  });\n\nText.displayName = 'Text';\n\nconst textStyle = {\n  backgroundColor: 'transparent',\n  border: '0 solid black',\n  boxSizing: 'border-box',\n  color: 'black',\n  display: 'inline',\n  font: '14px System',\n  listStyle: 'none',\n  margin: 0,\n  padding: 0,\n  position: 'relative',\n  textAlign: 'start',\n  textDecoration: 'none',\n  whiteSpace: 'pre-wrap',\n  wordWrap: 'break-word'\n};\n\nconst styles = StyleSheet.create({\n  text$raw: textStyle,\n  textHasAncestor$raw: {\n    ...textStyle,\n    color: 'inherit',\n    font: 'inherit',\n    textAlign: 'inherit',\n    whiteSpace: 'inherit'\n  },\n  textOneLine: {\n    maxWidth: '100%',\n    overflow: 'hidden',\n    textOverflow: 'ellipsis',\n    whiteSpace: 'nowrap',\n    wordWrap: 'normal'\n  },\n  // See #13\n  textMultiLine: {\n    display: '-webkit-box',\n    maxWidth: '100%',\n    overflow: 'clip',\n    textOverflow: 'ellipsis',\n    WebkitBoxOrient: 'vertical'\n  },\n  notSelectable: {\n    userSelect: 'none'\n  },\n  selectable: {\n    userSelect: 'text'\n  },\n  pressable: {\n    cursor: 'pointer'\n  }\n});\n\nexport default Text;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Text/types.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport type { ColorValue, GenericStyleProp } from '../../types';\nimport type { ViewProps, ViewStyle } from '../View/types';\n\ntype FontWeightValue =\n  | 'normal'\n  | 'bold'\n  | '100'\n  | '200'\n  | '300'\n  | '400'\n  | '500'\n  | '600'\n  | '700'\n  | '800'\n  | '900';\n\ntype NumberOrString = number | string;\n\nexport type TextStyle = {\n  ...ViewStyle,\n  color?: ?ColorValue,\n  fontFamily?: ?string,\n  fontFeatureSettings?: ?string,\n  fontSize?: ?NumberOrString,\n  fontStyle?: 'italic' | 'normal',\n  fontWeight?: ?FontWeightValue,\n  fontVariant?: $ReadOnlyArray<\n    | 'small-caps'\n    | 'oldstyle-nums'\n    | 'lining-nums'\n    | 'tabular-nums'\n    | 'proportional-nums'\n  >,\n  letterSpacing?: ?NumberOrString,\n  lineHeight?: ?NumberOrString,\n  textAlign?:\n    | 'center'\n    | 'end'\n    | 'inherit'\n    | 'justify'\n    | 'justify-all'\n    | 'left'\n    | 'right'\n    | 'start',\n  textDecorationColor?: ?ColorValue,\n  textDecorationLine?:\n    | 'none'\n    | 'underline'\n    | 'line-through'\n    | 'underline line-through',\n  textDecorationStyle?: 'solid' | 'double' | 'dotted' | 'dashed',\n  textIndent?: ?NumberOrString,\n  textOverflow?: ?string,\n  textRendering?:\n    | 'auto'\n    | 'geometricPrecision'\n    | 'optimizeLegibility'\n    | 'optimizeSpeed',\n  textShadow?: ?string,\n  textShadowColor?: ?ColorValue,\n  textShadowOffset?: {| width?: number, height?: number |},\n  textShadowRadius?: ?number,\n  textTransform?: 'capitalize' | 'lowercase' | 'none' | 'uppercase',\n  unicodeBidi?:\n    | 'normal'\n    | 'bidi-override'\n    | 'embed'\n    | 'isolate'\n    | 'isolate-override'\n    | 'plaintext',\n  userSelect?: 'none' | 'text',\n  verticalAlign?: ?string,\n  whiteSpace?: ?string,\n  wordBreak?: 'normal' | 'break-all' | 'break-word' | 'keep-all',\n  wordWrap?: ?string,\n  writingDirection?: 'auto' | 'ltr' | 'rtl',\n  /* @platform web */\n  MozOsxFontSmoothing?: ?string,\n  WebkitFontSmoothing?: ?string,\n  // deprecated\n  textAlignVertical?: ?string\n};\n\nexport type TextProps = {\n  ...ViewProps,\n  dir?: 'auto' | 'ltr' | 'rtl',\n  numberOfLines?: ?number,\n  role?:\n    | 'button'\n    | 'header'\n    | 'heading'\n    | 'label'\n    | 'link'\n    | 'listitem'\n    | 'none'\n    | 'text',\n  style?: GenericStyleProp<TextStyle>,\n  testID?: ?string,\n  // @deprecated\n  accessibilityRole?:\n    | 'button'\n    | 'header'\n    | 'heading'\n    | 'label'\n    | 'link'\n    | 'listitem'\n    | 'none'\n    | 'text',\n  onPress?: (e: any) => void,\n  selectable?: boolean\n};\n"
  },
  {
    "path": "packages/react-native-web/src/exports/TextInput/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport React from 'react';\nimport TextInput from '..';\nimport { createEventTarget } from 'dom-event-testing-library';\nimport { act, render } from '@testing-library/react';\n\nfunction findInput(container) {\n  return container.querySelector('input');\n}\n\nfunction findTextArea(container) {\n  return container.querySelector('textarea');\n}\n\nconst testIfDocumentIsFocused = (message, fn) => {\n  if (document.hasFocus && document.hasFocus()) {\n    test(message, fn);\n  } else {\n    test.skip(`${message} – document is not focused`, () => {});\n  }\n};\n\nfunction createEvent(type, data = {}) {\n  const event = document.createEvent('CustomEvent');\n  event.initCustomEvent(type, true, true);\n  if (data != null) {\n    Object.keys(data).forEach((key) => {\n      const value = data[key];\n      if (key === 'timeStamp' && !value) {\n        return;\n      }\n      Object.defineProperty(event, key, { value });\n    });\n  }\n  return event;\n}\n\nfunction createKeyboardEvent(\n  type,\n  {\n    altKey = false,\n    ctrlKey = false,\n    isComposing = false,\n    key = '',\n    keyCode = 0,\n    metaKey = false,\n    preventDefault = () => {},\n    shiftKey = false\n  } = {}\n) {\n  return createEvent(type, {\n    altKey,\n    ctrlKey,\n    isComposing,\n    key,\n    keyCode,\n    metaKey,\n    preventDefault,\n    shiftKey\n  });\n}\n\nfunction keydown(payload) {\n  return createKeyboardEvent('keydown', payload);\n}\n\ndescribe('components/TextInput', () => {\n  describe('prop \"autoComplete\"', () => {\n    test('value \"on\"', () => {\n      const { container } = render(<TextInput />);\n      const input = findInput(container);\n      expect(input.getAttribute('autoComplete')).toEqual('on');\n    });\n\n    test('value \"off\"', () => {\n      const { container } = render(<TextInput autoComplete=\"off\" />);\n      const input = findInput(container);\n      expect(input.getAttribute('autoComplete')).toEqual('off');\n    });\n\n    test('autoCompleteType fallback', () => {\n      const { container } = render(<TextInput autoCompleteType=\"off\" />);\n      const input = findInput(container);\n      expect(input.getAttribute('autoComplete')).toEqual('off');\n    });\n  });\n\n  describe('prop \"autoFocus\"', () => {\n    test('value \"false\"', () => {\n      const { container } = render(<TextInput />);\n      const input = findInput(container);\n      expect(document.activeElement).not.toBe(input);\n    });\n\n    test('value \"true\"', () => {\n      const { container } = render(<TextInput autoFocus />);\n      const input = findInput(container);\n      expect(document.activeElement).toBe(input);\n    });\n  });\n\n  describe('prop \"caretHidden\"', () => {\n    test('value \"true\"', () => {\n      const { container } = render(<TextInput caretHidden />);\n      const style = window.getComputedStyle(container.firstChild);\n      expect(style.caretColor).toEqual('transparent');\n    });\n  });\n\n  describe('prop \"clearTextOnFocus\"', () => {\n    const defaultValue = 'defaultValue';\n\n    testIfDocumentIsFocused('value \"false\"', () => {\n      const { container } = render(<TextInput defaultValue={defaultValue} />);\n      const input = findInput(container);\n      input.focus();\n      expect(input.node.value).toEqual(defaultValue);\n    });\n\n    testIfDocumentIsFocused('value \"true\"', () => {\n      const { container } = render(\n        <TextInput clearTextOnFocus defaultValue={defaultValue} />\n      );\n      const input = findInput(container);\n      input.focus();\n      expect(input.node.value).toEqual('');\n    });\n  });\n\n  test('prop \"defaultValue\"', () => {\n    const defaultValue = 'defaultValue';\n    const { container } = render(<TextInput defaultValue={defaultValue} />);\n    const input = findInput(container);\n    expect(input.value).toEqual(defaultValue);\n  });\n\n  describe('prop \"disabled\"', () => {\n    test('value \"false\"', () => {\n      const { container } = render(<TextInput />);\n      const input = findInput(container);\n      expect(input.disabled).toEqual(false);\n    });\n\n    test('value \"true\"', () => {\n      const { container } = render(<TextInput disabled={true} />);\n      const input = findInput(container);\n      expect(input.disabled).toEqual(true);\n    });\n  });\n\n  describe('prop \"editable\"', () => {\n    test('value \"true\"', () => {\n      const { container } = render(<TextInput />);\n      const input = findInput(container);\n      expect(input.readOnly).toEqual(false);\n    });\n\n    test('value \"false\"', () => {\n      const { container } = render(<TextInput editable={false} />);\n      const input = findInput(container);\n      expect(input.readOnly).toEqual(true);\n    });\n  });\n\n  describe('prop \"inputMode\"', () => {\n    test('value \"decimal\"', () => {\n      const { container } = render(<TextInput inputMode=\"decimal\" />);\n      const input = findInput(container);\n      expect(input.inputMode).toEqual('decimal');\n    });\n\n    test('value \"email\"', () => {\n      const { container } = render(<TextInput inputMode=\"email\" />);\n      const input = findInput(container);\n      expect(input.inputMode).toEqual('email');\n      expect(input.type).toEqual('email');\n    });\n\n    test('default value', () => {\n      const { container } = render(<TextInput inputMode=\"none\" />);\n      const input = findInput(container);\n      expect(input.inputMode).toEqual('none');\n      expect(input.type).toEqual('text');\n    });\n\n    test('value \"numeric\"', () => {\n      const { container } = render(<TextInput inputMode=\"numeric\" />);\n      const input = findInput(container);\n      expect(input.inputMode).toEqual('numeric');\n    });\n\n    test('value \"search\"', () => {\n      const { container } = render(<TextInput inputMode=\"search\" />);\n      const input = findInput(container);\n      expect(input.inputMode).toEqual('search');\n      expect(input.type).toEqual('search');\n    });\n\n    test('value \"tel\"', () => {\n      const { container } = render(<TextInput inputMode=\"tel\" />);\n      const input = findInput(container);\n      expect(input.inputMode).toEqual('tel');\n      expect(input.type).toEqual('tel');\n    });\n\n    test('value \"text\"', () => {\n      const { container } = render(<TextInput inputMode=\"text\" />);\n      const input = findInput(container);\n      expect(input.inputMode).toEqual('text');\n      expect(input.type).toEqual('text');\n    });\n\n    test('value \"url\"', () => {\n      const { container } = render(<TextInput inputMode=\"url\" />);\n      const input = findInput(container);\n      expect(input.inputMode).toEqual('url');\n      expect(input.type).toEqual('url');\n    });\n  });\n\n  describe('prop \"keyboardType\"', () => {\n    test('default value', () => {\n      const { container } = render(<TextInput keyboardType=\"default\" />);\n      const input = findInput(container);\n      expect(input.type).toEqual('text');\n    });\n\n    test('value \"email-address\"', () => {\n      const { container } = render(<TextInput keyboardType=\"email-address\" />);\n      const input = findInput(container);\n      expect(input.type).toEqual('email');\n    });\n\n    test('value \"decimal-pad\"', () => {\n      const { container } = render(<TextInput keyboardType=\"decimal-pad\" />);\n      const input = findInput(container);\n      expect(input.inputMode).toEqual('decimal');\n    });\n\n    test('value \"number-pad\"', () => {\n      const { container } = render(<TextInput keyboardType=\"number-pad\" />);\n      const input = findInput(container);\n      expect(input.inputMode).toEqual('numeric');\n    });\n\n    test('value \"numeric\"', () => {\n      const { container } = render(<TextInput keyboardType=\"numeric\" />);\n      const input = findInput(container);\n      expect(input.inputMode).toEqual('numeric');\n    });\n\n    test('value \"phone-pad\"', () => {\n      const { container } = render(<TextInput keyboardType=\"phone-pad\" />);\n      const input = findInput(container);\n      expect(input.type).toEqual('tel');\n    });\n\n    test('value \"url\"', () => {\n      const { container } = render(<TextInput keyboardType=\"url\" />);\n      const input = findInput(container);\n      expect(input.type).toEqual('url');\n    });\n  });\n\n  test('prop \"maxLength\"', () => {\n    let { container } = render(<TextInput />);\n    let input = findInput(container);\n    expect(input.getAttribute('maxLength')).toEqual(null);\n\n    ({ container } = render(<TextInput maxLength={10} />));\n    input = findInput(container);\n    expect(input.getAttribute('maxLength')).toEqual('10');\n  });\n\n  describe('prop \"multiline\"', () => {\n    test('value \"false\"', () => {\n      const { container } = render(<TextInput />);\n      const input = findInput(container);\n      expect(input).toBeDefined();\n    });\n\n    test('value \"true\"', () => {\n      const { container } = render(<TextInput multiline />);\n      const textarea = findTextArea(container);\n      expect(textarea).toBeDefined();\n    });\n  });\n\n  describe('prop \"numberOfLines\"', () => {\n    test('without \"multiline\"', () => {\n      const { container } = render(<TextInput numberOfLines={2} />);\n      const input = findInput(container);\n      const textarea = findTextArea(container);\n      expect(input).toBeDefined();\n      expect(textarea).toBeNull();\n    });\n\n    test('with \"multiline\"', () => {\n      const { container } = render(<TextInput multiline numberOfLines={3} />);\n      const textarea = findTextArea(container);\n      expect(textarea.getAttribute('rows')).toEqual('3');\n    });\n  });\n\n  test('prop \"onBlur\"', () => {\n    const onBlur = jest.fn();\n    const ref = React.createRef();\n    act(() => {\n      render(<TextInput onBlur={onBlur} ref={ref} />);\n    });\n    const target = createEventTarget(ref.current);\n    const body = createEventTarget(document.body);\n    act(() => {\n      target.focus();\n      body.focus({ relatedTarget: target.node });\n    });\n    expect(onBlur).toHaveBeenCalledTimes(1);\n    expect(TextInput.State.currentlyFocusedField()).toBe(null);\n  });\n\n  test.skip('prop \"onChange\"', () => {\n    const onChange = jest.fn();\n    const { container } = render(<TextInput onChange={onChange} />);\n    const input = findInput(container);\n    // This doesn't cause ReactDOM to trigger 'change' event... ¯\\_(ツ)_/¯\n    input.dispatchEvent(new window.Event('change', { bubbles: true }));\n    expect(onChange).toHaveBeenCalledTimes(1);\n  });\n\n  test.skip('prop \"onChangeText\"', () => {\n    const onChangeText = jest.fn();\n    const { container } = render(<TextInput onChangeText={onChangeText} />);\n    const input = findInput(container);\n    // This doesn't cause ReactDOM to trigger 'change' event... ¯\\_(ツ)_/¯\n    input.dispatchEvent(keydown({ key: 'a' }));\n    input.dispatchEvent(new window.Event('change', { bubbles: true }));\n    expect(onChangeText).toHaveBeenCalledTimes(1);\n    expect(onChangeText).toBeCalledWith('a');\n  });\n\n  test('prop \"onFocus\"', () => {\n    const onFocus = jest.fn();\n    const ref = React.createRef();\n    act(() => {\n      render(<TextInput onFocus={onFocus} ref={ref} />);\n    });\n    const target = createEventTarget(ref.current);\n    act(() => {\n      target.focus();\n    });\n    expect(onFocus).toHaveBeenCalledTimes(1);\n    target.node.focus();\n    expect(TextInput.State.currentlyFocusedField()).toBe(target.node);\n  });\n\n  describe('prop \"onKeyPress\"', () => {\n    test('arrow key', () => {\n      const onKeyPress = jest.fn((e) => {\n        e.persist();\n      });\n      const { container } = render(<TextInput onKeyPress={onKeyPress} />);\n      const input = findInput(container);\n      input.dispatchEvent(keydown({ key: 'ArrowLeft' }));\n      expect(onKeyPress).toHaveBeenCalledTimes(1);\n      expect(onKeyPress).toBeCalledWith(\n        expect.objectContaining({\n          nativeEvent: expect.objectContaining({\n            altKey: false,\n            ctrlKey: false,\n            key: 'ArrowLeft',\n            metaKey: false,\n            shiftKey: false,\n            target: expect.anything()\n          })\n        })\n      );\n    });\n\n    test('backspace key', () => {\n      const onKeyPress = jest.fn((e) => {\n        e.persist();\n      });\n      const { container } = render(<TextInput onKeyPress={onKeyPress} />);\n      const input = findInput(container);\n      input.dispatchEvent(keydown({ key: 'Backspace' }));\n      expect(onKeyPress).toHaveBeenCalledTimes(1);\n      expect(onKeyPress).toBeCalledWith(\n        expect.objectContaining({\n          nativeEvent: expect.objectContaining({\n            altKey: false,\n            ctrlKey: false,\n            key: 'Backspace',\n            metaKey: false,\n            shiftKey: false,\n            target: expect.anything()\n          })\n        })\n      );\n    });\n\n    test('enter key', () => {\n      const onKeyPress = jest.fn((e) => {\n        e.persist();\n      });\n      const { container } = render(<TextInput onKeyPress={onKeyPress} />);\n      const input = findInput(container);\n      input.dispatchEvent(keydown({ key: 'Enter' }));\n      expect(onKeyPress).toHaveBeenCalledTimes(1);\n      expect(onKeyPress).toBeCalledWith(\n        expect.objectContaining({\n          nativeEvent: expect.objectContaining({\n            altKey: false,\n            ctrlKey: false,\n            key: 'Enter',\n            metaKey: false,\n            shiftKey: false,\n            target: expect.anything()\n          })\n        })\n      );\n    });\n\n    test('escape key', () => {\n      const onKeyPress = jest.fn((e) => {\n        e.persist();\n      });\n      const { container } = render(<TextInput onKeyPress={onKeyPress} />);\n      const input = findInput(container);\n      input.dispatchEvent(keydown({ key: 'Escape' }));\n      expect(onKeyPress).toHaveBeenCalledTimes(1);\n      expect(onKeyPress).toBeCalledWith(\n        expect.objectContaining({\n          nativeEvent: expect.objectContaining({\n            altKey: false,\n            ctrlKey: false,\n            key: 'Escape',\n            metaKey: false,\n            shiftKey: false,\n            target: expect.anything()\n          })\n        })\n      );\n    });\n\n    test('space key', () => {\n      const onKeyPress = jest.fn((e) => {\n        e.persist();\n      });\n      const { container } = render(<TextInput onKeyPress={onKeyPress} />);\n      const input = findInput(container);\n      input.dispatchEvent(keydown({ key: ' ' }));\n      expect(onKeyPress).toHaveBeenCalledTimes(1);\n      expect(onKeyPress).toBeCalledWith(\n        expect.objectContaining({\n          nativeEvent: expect.objectContaining({\n            altKey: false,\n            ctrlKey: false,\n            key: ' ',\n            metaKey: false,\n            shiftKey: false,\n            target: expect.anything()\n          })\n        })\n      );\n    });\n\n    test('tab key', () => {\n      const onKeyPress = jest.fn((e) => {\n        e.persist();\n      });\n      const { container } = render(<TextInput onKeyPress={onKeyPress} />);\n      const input = findInput(container);\n      input.dispatchEvent(keydown({ key: 'Tab' }));\n      expect(onKeyPress).toHaveBeenCalledTimes(1);\n      expect(onKeyPress).toBeCalledWith(\n        expect.objectContaining({\n          nativeEvent: expect.objectContaining({\n            altKey: false,\n            ctrlKey: false,\n            key: 'Tab',\n            metaKey: false,\n            shiftKey: false,\n            target: expect.anything()\n          })\n        })\n      );\n    });\n\n    test('text key', () => {\n      const onKeyPress = jest.fn((e) => {\n        e.persist();\n      });\n      const { container } = render(<TextInput onKeyPress={onKeyPress} />);\n      const input = findInput(container);\n      input.dispatchEvent(keydown({ key: 'a' }));\n      expect(onKeyPress).toHaveBeenCalledTimes(1);\n      expect(onKeyPress).toBeCalledWith(\n        expect.objectContaining({\n          nativeEvent: expect.objectContaining({\n            altKey: false,\n            ctrlKey: false,\n            key: 'a',\n            metaKey: false,\n            shiftKey: false,\n            target: expect.anything()\n          })\n        })\n      );\n    });\n\n    test('modifier keys are included', () => {\n      const onKeyPress = jest.fn((e) => {\n        e.persist();\n      });\n      const { container } = render(<TextInput onKeyPress={onKeyPress} />);\n      const input = findInput(container);\n      input.dispatchEvent(\n        keydown({\n          altKey: true,\n          ctrlKey: true,\n          metaKey: true,\n          shiftKey: true,\n          key: ' '\n        })\n      );\n      expect(onKeyPress).toHaveBeenCalledTimes(1);\n      expect(onKeyPress).toBeCalledWith(\n        expect.objectContaining({\n          nativeEvent: expect.objectContaining({\n            altKey: true,\n            ctrlKey: true,\n            key: ' ',\n            metaKey: true,\n            shiftKey: true,\n            target: expect.anything()\n          })\n        })\n      );\n    });\n\n    test('meta key + Enter calls \"onKeyPress\"', () => {\n      const onKeyPress = jest.fn((e) => {\n        e.persist();\n      });\n      const { container } = render(<TextInput onKeyPress={onKeyPress} />);\n      const input = findInput(container);\n      input.dispatchEvent(\n        keydown({\n          metaKey: true,\n          key: 'Enter'\n        })\n      );\n      expect(onKeyPress).toHaveBeenCalledTimes(1);\n    });\n  });\n\n  describe('prop \"onSelectionChange\"', () => {\n    test('is called on select', () => {\n      const { container } = render(\n        <TextInput defaultValue=\"12345\" onSelectionChange={onSelectionChange} />\n      );\n      const input = findInput(container);\n      input.selectionStart = 0;\n      input.selectionEnd = 3;\n      input.dispatchEvent(new window.Event('select', {}));\n      function onSelectionChange(e) {\n        expect(e.nativeEvent.selection.end).toEqual(3);\n        expect(e.nativeEvent.selection.start).toEqual(0);\n      }\n    });\n\n    test.skip('is called on change', () => {\n      const onSelectionChange = jest.fn();\n      const { container } = render(\n        <TextInput onSelectionChange={onSelectionChange} />\n      );\n      const input = findInput(container);\n      // This doesn't cause ReactDOM to trigger 'change' event... ¯\\_(ツ)_/¯\n      input.dispatchEvent(new window.Event('input', { bubbles: true }));\n      expect(onSelectionChange).toHaveBeenCalledTimes(1);\n    });\n  });\n\n  describe('prop \"onSubmitEditing\"', () => {\n    test('single-line input', (done) => {\n      const { container } = render(\n        <TextInput defaultValue=\"12345\" onSubmitEditing={onSubmitEditing} />\n      );\n      const input = findInput(container);\n      input.dispatchEvent(keydown({ key: 'Enter' }));\n      function onSubmitEditing(e) {\n        expect(e.nativeEvent.target).toBeDefined();\n        expect(e.nativeEvent.text).toBe('12345');\n        done();\n      }\n    });\n\n    test('single-line input while composing', () => {\n      const onSubmitEditing = jest.fn();\n      const { container } = render(\n        <TextInput defaultValue=\"12345\" onSubmitEditing={onSubmitEditing} />\n      );\n      const input = findInput(container);\n      input.dispatchEvent(\n        keydown({ key: 'Enter', isComposing: true, keyCode: 13 })\n      );\n      input.dispatchEvent(\n        keydown({ key: 'Enter', isComposing: false, keyCode: 229 })\n      );\n      expect(onSubmitEditing).not.toHaveBeenCalled();\n    });\n\n    test('multi-line input', () => {\n      const onSubmitEditing = jest.fn();\n      const { container } = render(\n        <TextInput\n          defaultValue=\"12345\"\n          multiline\n          onSubmitEditing={onSubmitEditing}\n        />\n      );\n      const textarea = findTextArea(container);\n      textarea.dispatchEvent(keydown({ key: 'Enter' }));\n      expect(onSubmitEditing).not.toHaveBeenCalled();\n    });\n\n    test('multi-line input with \"blurOnSubmit\" triggers \"onSubmitEditing\"', () => {\n      const onSubmitEditing = jest.fn();\n      const preventDefault = jest.fn();\n\n      const { container } = render(\n        <TextInput\n          blurOnSubmit\n          defaultValue=\"12345\"\n          multiline\n          onSubmitEditing={onSubmitEditing}\n        />\n      );\n      const textarea = findTextArea(container);\n      textarea.dispatchEvent(\n        keydown({ key: 'Enter', preventDefault, shiftKey: true })\n      );\n      // shift+enter should enter newline, not submit\n      expect(onSubmitEditing).not.toHaveBeenCalledWith(\n        expect.objectContaining({ shiftKey: true })\n      );\n      expect(preventDefault).not.toHaveBeenCalled();\n\n      textarea.dispatchEvent(keydown({ key: 'Enter', preventDefault }));\n      expect(onSubmitEditing).toHaveBeenCalledTimes(1);\n      expect(preventDefault).toHaveBeenCalledTimes(1);\n    });\n  });\n\n  test('prop \"returnKeyType\"', () => {\n    const returnKeyType = 'previous';\n    const { container } = render(<TextInput returnKeyType={returnKeyType} />);\n    const input = findInput(container);\n    expect(input.getAttribute('enterkeyhint')).toEqual(returnKeyType);\n  });\n\n  test('prop \"secureTextEntry\"', () => {\n    let { container } = render(<TextInput secureTextEntry />);\n    const input = findInput(container);\n    expect(input.getAttribute('type')).toEqual('password');\n    // ignored for multiline\n    ({ container } = render(<TextInput multiline secureTextEntry />));\n    const textarea = findTextArea(container);\n    expect(textarea.getAttribute('type')).toEqual(null);\n  });\n\n  describe('prop \"selectTextOnFocus\"', () => {\n    testIfDocumentIsFocused('value \"false\"', () => {\n      const { container } = render(<TextInput defaultValue={'text'} />);\n      const input = findInput(container);\n      input.focus();\n      expect(input.selectionEnd).toEqual(4);\n      expect(input.selectionStart).toEqual(4);\n    });\n\n    // testIfDocumentIsFocused('value \"true\"', () => {\n    // const input = findNativeInput(mount(<TextInput defaultValue={'text'} selectTextOnFocus />));\n    // input.node.focus()\n    // assert.equal(input.node.selectionEnd, 4)\n    // assert.equal(input.node.selectionStart, 0)\n    // });\n  });\n\n  describe('prop \"selection\"', () => {\n    test('set cursor location', () => {\n      const cursorLocation = { start: 3, end: 3 };\n      const { container: defaultContainer } = render(\n        <TextInput defaultValue=\"12345\" />\n      );\n      const inputDefaultSelection = findInput(defaultContainer);\n      // default selection is at the end\n      expect(inputDefaultSelection.selectionStart).toEqual(5);\n      expect(inputDefaultSelection.selectionEnd).toEqual(5);\n\n      const { container: customContainer } = render(\n        <TextInput defaultValue=\"12345\" selection={cursorLocation} />\n      );\n      const inputCustomSelection = findInput(customContainer);\n      // custom selection sets cursor at custom position\n      expect(inputCustomSelection.selectionStart).toEqual(cursorLocation.start);\n      expect(inputCustomSelection.selectionEnd).toEqual(cursorLocation.end);\n    });\n  });\n\n  describe('prop \"spellCheck\"', () => {\n    test('default value', () => {\n      const { container } = render(<TextInput />);\n      const input = findInput(container);\n      expect(input.getAttribute('spellCheck')).toEqual('true');\n    });\n\n    test('inherit from \"autoCorrect\"', () => {\n      const { container } = render(<TextInput autoCorrect={false} />);\n      const input = findInput(container);\n      expect(input.getAttribute('spellCheck')).toEqual('false');\n    });\n\n    test('value \"false\"', () => {\n      const { container } = render(<TextInput spellCheck={false} />);\n      const input = findInput(container);\n      expect(input.getAttribute('spellCheck')).toEqual('false');\n    });\n  });\n\n  test('prop \"value\"', () => {\n    const value = 'value';\n    const { container } = render(<TextInput value={value} />);\n    const input = findInput(container);\n    expect(input.value).toEqual(value);\n  });\n\n  describe('prop \"showSoftInputOnFocus\"', () => {\n    test('default value', () => {\n      const { container } = render(<TextInput />);\n      const input = findInput(container);\n      expect(input.getAttribute('virtualkeyboardpolicy')).toEqual('auto');\n    });\n\n    test('true value', () => {\n      const { container } = render(<TextInput showSoftInputOnFocus={true} />);\n      const input = findInput(container);\n      expect(input.getAttribute('virtualkeyboardpolicy')).toEqual('auto');\n    });\n\n    test('false value', () => {\n      const { container } = render(<TextInput showSoftInputOnFocus={false} />);\n      const input = findInput(container);\n      expect(input.getAttribute('virtualkeyboardpolicy')).toEqual('manual');\n    });\n  });\n\n  describe('imperative methods', () => {\n    test('node.clear()', () => {\n      const ref = React.createRef();\n      render(<TextInput ref={ref} />);\n      expect(typeof ref.current.clear).toBe('function');\n    });\n\n    test('node.isFocused()', () => {\n      const ref = React.createRef();\n      render(<TextInput ref={ref} />);\n      expect(typeof ref.current.isFocused).toBe('function');\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/TextInput/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use client';\n\nimport type { PlatformMethods } from '../../types';\nimport type { TextInputProps } from './types';\n\nimport * as React from 'react';\nimport createElement from '../createElement';\nimport * as forwardedProps from '../../modules/forwardedProps';\nimport pick from '../../modules/pick';\nimport useElementLayout from '../../modules/useElementLayout';\nimport useLayoutEffect from '../../modules/useLayoutEffect';\nimport useMergeRefs from '../../modules/useMergeRefs';\nimport usePlatformMethods from '../../modules/usePlatformMethods';\nimport useResponderEvents from '../../modules/useResponderEvents';\nimport { getLocaleDirection, useLocaleContext } from '../../modules/useLocale';\nimport StyleSheet from '../StyleSheet';\nimport TextInputState from '../../modules/TextInputState';\n//import { warnOnce } from '../../modules/warnOnce';\n\n/**\n * Determines whether a 'selection' prop differs from a node's existing\n * selection state.\n */\nconst isSelectionStale = (node, selection) => {\n  const { selectionEnd, selectionStart } = node;\n  const { start, end } = selection;\n  return start !== selectionStart || end !== selectionEnd;\n};\n\n/**\n * Certain input types do no support 'selectSelectionRange' and will throw an\n * error.\n */\nconst setSelection = (node, selection) => {\n  if (isSelectionStale(node, selection)) {\n    const { start, end } = selection;\n    try {\n      node.setSelectionRange(start, end || start);\n    } catch (e) {}\n  }\n};\n\nconst forwardPropsList = Object.assign(\n  {},\n  forwardedProps.defaultProps,\n  forwardedProps.accessibilityProps,\n  forwardedProps.clickProps,\n  forwardedProps.focusProps,\n  forwardedProps.keyboardProps,\n  forwardedProps.mouseProps,\n  forwardedProps.touchProps,\n  forwardedProps.styleProps,\n  {\n    autoCapitalize: true,\n    autoComplete: true,\n    autoCorrect: true,\n    autoFocus: true,\n    defaultValue: true,\n    disabled: true,\n    lang: true,\n    maxLength: true,\n    onChange: true,\n    onScroll: true,\n    placeholder: true,\n    pointerEvents: true,\n    readOnly: true,\n    rows: true,\n    spellCheck: true,\n    value: true,\n    type: true\n  }\n);\n\nconst pickProps = (props) => pick(props, forwardPropsList);\n\n// If an Input Method Editor is processing key input, the 'keyCode' is 229.\n// https://www.w3.org/TR/uievents/#determine-keydown-keyup-keyCode\nfunction isEventComposing(nativeEvent) {\n  return nativeEvent.isComposing || nativeEvent.keyCode === 229;\n}\n\nlet focusTimeout: ?TimeoutID = null;\n\nconst TextInput: React.AbstractComponent<\n  TextInputProps,\n  HTMLElement & PlatformMethods\n> = React.forwardRef((props, forwardedRef) => {\n  const {\n    autoCapitalize = 'sentences',\n    autoComplete,\n    autoCompleteType,\n    autoCorrect = true,\n    blurOnSubmit,\n    caretHidden,\n    clearTextOnFocus,\n    dir,\n    editable,\n    enterKeyHint,\n    inputMode,\n    keyboardType,\n    multiline = false,\n    numberOfLines,\n    onBlur,\n    onChange,\n    onChangeText,\n    onContentSizeChange,\n    onFocus,\n    onKeyPress,\n    onLayout,\n    onMoveShouldSetResponder,\n    onMoveShouldSetResponderCapture,\n    onResponderEnd,\n    onResponderGrant,\n    onResponderMove,\n    onResponderReject,\n    onResponderRelease,\n    onResponderStart,\n    onResponderTerminate,\n    onResponderTerminationRequest,\n    onScrollShouldSetResponder,\n    onScrollShouldSetResponderCapture,\n    onSelectionChange,\n    onSelectionChangeShouldSetResponder,\n    onSelectionChangeShouldSetResponderCapture,\n    onStartShouldSetResponder,\n    onStartShouldSetResponderCapture,\n    onSubmitEditing,\n    placeholderTextColor,\n    readOnly = false,\n    returnKeyType,\n    rows,\n    secureTextEntry = false,\n    selection,\n    selectTextOnFocus,\n    showSoftInputOnFocus,\n    spellCheck\n  } = props;\n\n  let type;\n  let _inputMode;\n\n  if (inputMode != null) {\n    _inputMode = inputMode;\n    if (inputMode === 'email') {\n      type = 'email';\n    } else if (inputMode === 'tel') {\n      type = 'tel';\n    } else if (inputMode === 'search') {\n      type = 'search';\n    } else if (inputMode === 'url') {\n      type = 'url';\n    } else {\n      type = 'text';\n    }\n  } else if (keyboardType != null) {\n    // warnOnce('keyboardType', 'keyboardType is deprecated. Use inputMode.');\n    switch (keyboardType) {\n      case 'email-address':\n        type = 'email';\n        break;\n      case 'number-pad':\n      case 'numeric':\n        _inputMode = 'numeric';\n        break;\n      case 'decimal-pad':\n        _inputMode = 'decimal';\n        break;\n      case 'phone-pad':\n        type = 'tel';\n        break;\n      case 'search':\n      case 'web-search':\n        type = 'search';\n        break;\n      case 'url':\n        type = 'url';\n        break;\n      default:\n        type = 'text';\n    }\n  }\n\n  if (secureTextEntry) {\n    type = 'password';\n  }\n\n  const dimensions = React.useRef({ height: null, width: null });\n  const hostRef = React.useRef(null);\n  const prevSelection = React.useRef(null);\n  const prevSecureTextEntry = React.useRef(false);\n\n  React.useEffect(() => {\n    if (hostRef.current && prevSelection.current) {\n      setSelection(hostRef.current, prevSelection.current);\n    }\n    prevSecureTextEntry.current = secureTextEntry;\n  }, [secureTextEntry]);\n\n  const handleContentSizeChange = React.useCallback(\n    (hostNode) => {\n      if (multiline && onContentSizeChange && hostNode != null) {\n        const newHeight = hostNode.scrollHeight;\n        const newWidth = hostNode.scrollWidth;\n        if (\n          newHeight !== dimensions.current.height ||\n          newWidth !== dimensions.current.width\n        ) {\n          dimensions.current.height = newHeight;\n          dimensions.current.width = newWidth;\n          onContentSizeChange({\n            nativeEvent: {\n              contentSize: {\n                height: dimensions.current.height,\n                width: dimensions.current.width\n              }\n            }\n          });\n        }\n      }\n    },\n    [multiline, onContentSizeChange]\n  );\n\n  const imperativeRef = React.useMemo(\n    () => (hostNode) => {\n      // TextInput needs to add more methods to the hostNode in addition to those\n      // added by `usePlatformMethods`. This is temporarily until an API like\n      // `TextInput.clear(hostRef)` is added to React Native.\n      if (hostNode != null) {\n        hostNode.clear = function () {\n          if (hostNode != null) {\n            hostNode.value = '';\n          }\n        };\n        hostNode.isFocused = function () {\n          return (\n            hostNode != null &&\n            TextInputState.currentlyFocusedField() === hostNode\n          );\n        };\n        handleContentSizeChange(hostNode);\n      }\n    },\n    [handleContentSizeChange]\n  );\n\n  function handleBlur(e) {\n    TextInputState._currentlyFocusedNode = null;\n    if (onBlur) {\n      e.nativeEvent.text = e.target.value;\n      onBlur(e);\n    }\n  }\n\n  function handleChange(e) {\n    const hostNode = e.target;\n    const text = hostNode.value;\n    e.nativeEvent.text = text;\n    handleContentSizeChange(hostNode);\n    if (onChange) {\n      onChange(e);\n    }\n    if (onChangeText) {\n      onChangeText(text);\n    }\n  }\n\n  function handleFocus(e) {\n    const hostNode = e.target;\n    if (onFocus) {\n      e.nativeEvent.text = hostNode.value;\n      onFocus(e);\n    }\n    if (hostNode != null) {\n      TextInputState._currentlyFocusedNode = hostNode;\n      if (clearTextOnFocus) {\n        hostNode.value = '';\n      }\n      if (selectTextOnFocus) {\n        // Safari requires selection to occur in a setTimeout\n        if (focusTimeout != null) {\n          clearTimeout(focusTimeout);\n        }\n        focusTimeout = setTimeout(() => {\n          // Check if the input is still focused after the timeout\n          // (see #2704)\n          if (hostNode != null && document.activeElement === hostNode) {\n            hostNode.select();\n          }\n        }, 0);\n      }\n    }\n  }\n\n  function handleKeyDown(e) {\n    const hostNode = e.target;\n    // Prevent key events bubbling (see #612)\n    e.stopPropagation();\n\n    const blurOnSubmitDefault = !multiline;\n    const shouldBlurOnSubmit =\n      blurOnSubmit == null ? blurOnSubmitDefault : blurOnSubmit;\n\n    const nativeEvent = e.nativeEvent;\n    const isComposing = isEventComposing(nativeEvent);\n\n    if (onKeyPress) {\n      onKeyPress(e);\n    }\n\n    if (\n      e.key === 'Enter' &&\n      !e.shiftKey &&\n      // Do not call submit if composition is occuring.\n      !isComposing &&\n      !e.isDefaultPrevented()\n    ) {\n      if ((blurOnSubmit || !multiline) && onSubmitEditing) {\n        // prevent \"Enter\" from inserting a newline or submitting a form\n        e.preventDefault();\n        nativeEvent.text = e.target.value;\n        onSubmitEditing(e);\n      }\n      if (shouldBlurOnSubmit && hostNode != null) {\n        setTimeout(() => hostNode.blur(), 0);\n      }\n    }\n  }\n\n  function handleSelectionChange(e) {\n    try {\n      const { selectionStart, selectionEnd } = e.target;\n      const selection = {\n        start: selectionStart,\n        end: selectionEnd\n      };\n      if (onSelectionChange) {\n        e.nativeEvent.selection = selection;\n        e.nativeEvent.text = e.target.value;\n        onSelectionChange(e);\n      }\n      if (prevSecureTextEntry.current === secureTextEntry) {\n        prevSelection.current = selection;\n      }\n    } catch (e) {}\n  }\n\n  useLayoutEffect(() => {\n    const node = hostRef.current;\n    if (node != null && selection != null) {\n      setSelection(node, selection);\n    }\n    if (document.activeElement === node) {\n      TextInputState._currentlyFocusedNode = node;\n    }\n  }, [hostRef, selection]);\n\n  const component = multiline ? 'textarea' : 'input';\n\n  useElementLayout(hostRef, onLayout);\n  useResponderEvents(hostRef, {\n    onMoveShouldSetResponder,\n    onMoveShouldSetResponderCapture,\n    onResponderEnd,\n    onResponderGrant,\n    onResponderMove,\n    onResponderReject,\n    onResponderRelease,\n    onResponderStart,\n    onResponderTerminate,\n    onResponderTerminationRequest,\n    onScrollShouldSetResponder,\n    onScrollShouldSetResponderCapture,\n    onSelectionChangeShouldSetResponder,\n    onSelectionChangeShouldSetResponderCapture,\n    onStartShouldSetResponder,\n    onStartShouldSetResponderCapture\n  });\n  const { direction: contextDirection } = useLocaleContext();\n\n  const supportedProps = pickProps(props);\n  supportedProps.autoCapitalize = autoCapitalize;\n  supportedProps.autoComplete = autoComplete || autoCompleteType || 'on';\n  supportedProps.autoCorrect = autoCorrect ? 'on' : 'off';\n  // 'auto' by default allows browsers to infer writing direction\n  supportedProps.dir = dir !== undefined ? dir : 'auto';\n  /*\n  if (returnKeyType != null) {\n    warnOnce('returnKeyType', 'returnKeyType is deprecated. Use enterKeyHint.');\n  }\n  */\n  supportedProps.enterKeyHint = enterKeyHint || returnKeyType;\n  supportedProps.inputMode = _inputMode;\n  supportedProps.onBlur = handleBlur;\n  supportedProps.onChange = handleChange;\n  supportedProps.onFocus = handleFocus;\n  supportedProps.onKeyDown = handleKeyDown;\n  supportedProps.onSelect = handleSelectionChange;\n  /*\n  if (editable != null) {\n    warnOnce('editable', 'editable is deprecated. Use readOnly.');\n  }\n  */\n  supportedProps.readOnly = readOnly === true || editable === false;\n  /*\n  if (numberOfLines != null) {\n    warnOnce(\n      'numberOfLines',\n      'TextInput numberOfLines is deprecated. Use rows.'\n    );\n  }\n  */\n  supportedProps.rows = multiline ? (rows != null ? rows : numberOfLines) : 1;\n  supportedProps.spellCheck = spellCheck != null ? spellCheck : autoCorrect;\n  supportedProps.style = [\n    { '--placeholderTextColor': placeholderTextColor },\n    styles.textinput$raw,\n    styles.placeholder,\n    props.style,\n    caretHidden && styles.caretHidden\n  ];\n  supportedProps.type = multiline ? undefined : type;\n  supportedProps.virtualkeyboardpolicy =\n    showSoftInputOnFocus === false ? 'manual' : 'auto';\n\n  const platformMethodsRef = usePlatformMethods(supportedProps);\n\n  const setRef = useMergeRefs(\n    hostRef,\n    platformMethodsRef,\n    imperativeRef,\n    forwardedRef\n  );\n\n  supportedProps.ref = setRef;\n\n  const langDirection =\n    props.lang != null ? getLocaleDirection(props.lang) : null;\n  const componentDirection = props.dir || langDirection;\n  const writingDirection = componentDirection || contextDirection;\n\n  const element = createElement(component, supportedProps, {\n    writingDirection\n  });\n\n  return element;\n});\n\nTextInput.displayName = 'TextInput';\n// $FlowFixMe\nTextInput.State = TextInputState;\n\nconst styles = StyleSheet.create({\n  textinput$raw: {\n    MozAppearance: 'textfield',\n    WebkitAppearance: 'none',\n    backgroundColor: 'transparent',\n    border: '0 solid black',\n    borderRadius: 0,\n    boxSizing: 'border-box',\n    font: '14px System',\n    margin: 0,\n    padding: 0,\n    resize: 'none'\n  },\n  placeholder: {\n    placeholderTextColor: 'var(--placeholderTextColor)'\n  },\n  caretHidden: {\n    caretColor: 'transparent'\n  }\n});\n\nexport default TextInput;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/TextInput/types.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nimport type { ColorValue, GenericStyleProp } from '../../types';\nimport type { TextStyle } from '../Text/types';\nimport type { ViewProps } from '../View/types';\n\nexport type TextInputStyle = {\n  ...TextStyle,\n  caretColor?: ColorValue,\n  resize?: 'none' | 'vertical' | 'horizontal' | 'both'\n};\n\nexport type TextInputProps = {\n  ...ViewProps,\n  autoCapitalize?: 'characters' | 'none' | 'sentences' | 'words',\n  autoComplete?: ?string,\n  autoCompleteType?: ?string, // Compat with React Native (Bug react-native#26003)\n  autoCorrect?: ?boolean,\n  autoFocus?: ?boolean,\n  blurOnSubmit?: ?boolean,\n  caretHidden?: ?boolean,\n  clearTextOnFocus?: ?boolean,\n  defaultValue?: ?string,\n  dir?: ?('auto' | 'ltr' | 'rtl'),\n  disabled?: ?boolean,\n  enterKeyHint?:\n    | 'enter'\n    | 'done'\n    | 'go'\n    | 'next'\n    | 'previous'\n    | 'search'\n    | 'send',\n  inputAccessoryViewID?: ?string,\n  inputMode?:\n    | 'decimal'\n    | 'email'\n    | 'none'\n    | 'numeric'\n    | 'search'\n    | 'tel'\n    | 'text'\n    | 'url',\n  maxLength?: ?number,\n  multiline?: ?boolean,\n  onChange?: (e: any) => void,\n  onChangeText?: (e: string) => void,\n  onContentSizeChange?: (e: any) => void,\n  onEndEditing?: (e: any) => void,\n  onKeyPress?: (e: any) => void,\n  onSelectionChange?: (e: any) => void,\n  onScroll?: (e: any) => void,\n  onSubmitEditing?: (e: any) => void,\n  placeholder?: ?string,\n  placeholderTextColor?: ?ColorValue,\n  readOnly?: ?boolean,\n  rows?: ?number,\n  secureTextEntry?: ?boolean,\n  selectTextOnFocus?: ?boolean,\n  selection?: {|\n    start: number,\n    end?: number\n  |},\n  selectionColor?: ?ColorValue,\n  showSoftInputOnFocus?: ?boolean,\n  spellCheck?: ?boolean,\n  style?: ?GenericStyleProp<TextInputStyle>,\n  value?: ?string,\n  // deprecated\n  editable?: ?boolean,\n  keyboardType?:\n    | 'default'\n    | 'email-address'\n    | 'number-pad'\n    | 'numbers-and-punctuation'\n    | 'numeric'\n    | 'phone-pad'\n    | 'search'\n    | 'url'\n    | 'web-search',\n  numberOfLines?: ?number,\n  returnKeyType?:\n    | 'enter'\n    | 'done'\n    | 'go'\n    | 'next'\n    | 'previous'\n    | 'search'\n    | 'send'\n};\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Touchable/BoundingDimensions.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport PooledClass from '../../vendor/react-native/PooledClass';\n\nconst twoArgumentPooler = PooledClass.twoArgumentPooler;\n\n/**\n * PooledClass representing the bounding rectangle of a region.\n */\nfunction BoundingDimensions(width: number, height: number) {\n  this.width = width;\n  this.height = height;\n}\n\nBoundingDimensions.prototype.destructor = function () {\n  this.width = null;\n  this.height = null;\n};\n\nBoundingDimensions.getPooledFromElement = function (element: HTMLElement): any {\n  return BoundingDimensions.getPooled(\n    element.offsetWidth,\n    element.offsetHeight\n  );\n};\n\nPooledClass.addPoolingTo(BoundingDimensions, twoArgumentPooler);\n\nexport default BoundingDimensions;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Touchable/Position.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @noflow\n */\n\nimport PooledClass from '../../vendor/react-native/PooledClass';\n\nconst twoArgumentPooler = PooledClass.twoArgumentPooler;\n\nfunction Position(left, top) {\n  this.left = left;\n  this.top = top;\n}\n\nPosition.prototype.destructor = function () {\n  this.left = null;\n  this.top = null;\n};\n\nPooledClass.addPoolingTo(Position, twoArgumentPooler);\n\nexport default Position;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Touchable/ensurePositiveDelayProps.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport invariant from 'fbjs/lib/invariant';\n\nconst ensurePositiveDelayProps = (props: any) => {\n  invariant(\n    !(\n      props.delayPressIn < 0 ||\n      props.delayPressOut < 0 ||\n      props.delayLongPress < 0\n    ),\n    'Touchable components cannot have negative delay properties'\n  );\n};\n\nexport default ensurePositiveDelayProps;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Touchable/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\nimport type { Node } from 'React';\n\nimport AccessibilityUtil from '../../modules/AccessibilityUtil';\nimport BoundingDimensions from './BoundingDimensions';\nimport normalizeColor from '@react-native/normalize-colors';\nimport Position from './Position';\nimport React from 'react';\nimport UIManager from '../UIManager';\nimport View from '../View';\nimport { warnOnce } from '../../modules/warnOnce';\n\ntype Event = Object;\ntype PressEvent = Object;\ntype EdgeInsetsProp = Object;\n\nconst extractSingleTouch = (nativeEvent) => {\n  const touches = nativeEvent.touches;\n  const changedTouches = nativeEvent.changedTouches;\n  const hasTouches = touches && touches.length > 0;\n  const hasChangedTouches = changedTouches && changedTouches.length > 0;\n\n  return !hasTouches && hasChangedTouches\n    ? changedTouches[0]\n    : hasTouches\n    ? touches[0]\n    : nativeEvent;\n};\n\n/**\n * `Touchable`: Taps done right.\n *\n * You hook your `ResponderEventPlugin` events into `Touchable`. `Touchable`\n * will measure time/geometry and tells you when to give feedback to the user.\n *\n * ====================== Touchable Tutorial ===============================\n * The `Touchable` mixin helps you handle the \"press\" interaction. It analyzes\n * the geometry of elements, and observes when another responder (scroll view\n * etc) has stolen the touch lock. It notifies your component when it should\n * give feedback to the user. (bouncing/highlighting/unhighlighting).\n *\n * - When a touch was activated (typically you highlight)\n * - When a touch was deactivated (typically you unhighlight)\n * - When a touch was \"pressed\" - a touch ended while still within the geometry\n *   of the element, and no other element (like scroller) has \"stolen\" touch\n *   lock (\"responder\") (Typically you bounce the element).\n *\n * A good tap interaction isn't as simple as you might think. There should be a\n * slight delay before showing a highlight when starting a touch. If a\n * subsequent touch move exceeds the boundary of the element, it should\n * unhighlight, but if that same touch is brought back within the boundary, it\n * should rehighlight again. A touch can move in and out of that boundary\n * several times, each time toggling highlighting, but a \"press\" is only\n * triggered if that touch ends while within the element's boundary and no\n * scroller (or anything else) has stolen the lock on touches.\n *\n * To create a new type of component that handles interaction using the\n * `Touchable` mixin, do the following:\n *\n * - Initialize the `Touchable` state.\n *\n *   getInitialState: function() {\n *     return merge(this.touchableGetInitialState(), yourComponentState);\n *   }\n *\n * - Add a method to get your touchable component's node.\n *   getTouchableNode: function() {\n *     return this.touchableRef.current\n *   }\n *\n * - Choose the rendered component who's touches should start the interactive\n *   sequence. On that rendered node, forward all `Touchable` responder\n *   handlers. You can choose any rendered node you like. Choose a node whose\n *   hit target you'd like to instigate the interaction sequence:\n *\n *   // In render function:\n *   return (\n *     <View\n *       ref={this.touchableRef}\n *       onStartShouldSetResponder={this.touchableHandleStartShouldSetResponder}\n *       onResponderTerminationRequest={this.touchableHandleResponderTerminationRequest}\n *       onResponderGrant={this.touchableHandleResponderGrant}\n *       onResponderMove={this.touchableHandleResponderMove}\n *       onResponderRelease={this.touchableHandleResponderRelease}\n *       onResponderTerminate={this.touchableHandleResponderTerminate}>\n *       <View>\n *         Even though the hit detection/interactions are triggered by the\n *         wrapping (typically larger) node, we usually end up implementing\n *         custom logic that highlights this inner one.\n *       </View>\n *     </View>\n *   );\n *\n * - You may set up your own handlers for each of these events, so long as you\n *   also invoke the `touchable*` handlers inside of your custom handler.\n *\n * - Implement the handlers on your component class in order to provide\n *   feedback to the user. See documentation for each of these class methods\n *   that you should implement.\n *\n *   touchableHandlePress: function() {\n *      this.performBounceAnimation();  // or whatever you want to do.\n *   },\n *   touchableHandleActivePressIn: function() {\n *     this.beginHighlighting(...);  // Whatever you like to convey activation\n *   },\n *   touchableHandleActivePressOut: function() {\n *     this.endHighlighting(...);  // Whatever you like to convey deactivation\n *   },\n *\n * - There are more advanced methods you can implement (see documentation below):\n *   touchableGetHighlightDelayMS: function() {\n *     return 20;\n *   }\n *   // In practice, *always* use a predeclared constant (conserve memory).\n *   touchableGetPressRectOffset: function() {\n *     return {top: 20, left: 20, right: 20, bottom: 100};\n *   }\n */\n\n/**\n * Touchable states.\n */\n\nconst States = {\n  NOT_RESPONDER: 'NOT_RESPONDER', // Not the responder\n  RESPONDER_INACTIVE_PRESS_IN: 'RESPONDER_INACTIVE_PRESS_IN', // Responder, inactive, in the `PressRect`\n  RESPONDER_INACTIVE_PRESS_OUT: 'RESPONDER_INACTIVE_PRESS_OUT', // Responder, inactive, out of `PressRect`\n  RESPONDER_ACTIVE_PRESS_IN: 'RESPONDER_ACTIVE_PRESS_IN', // Responder, active, in the `PressRect`\n  RESPONDER_ACTIVE_PRESS_OUT: 'RESPONDER_ACTIVE_PRESS_OUT', // Responder, active, out of `PressRect`\n  RESPONDER_ACTIVE_LONG_PRESS_IN: 'RESPONDER_ACTIVE_LONG_PRESS_IN', // Responder, active, in the `PressRect`, after long press threshold\n  RESPONDER_ACTIVE_LONG_PRESS_OUT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT', // Responder, active, out of `PressRect`, after long press threshold\n  ERROR: 'ERROR'\n};\n\ntype State =\n  | typeof States.NOT_RESPONDER\n  | typeof States.RESPONDER_INACTIVE_PRESS_IN\n  | typeof States.RESPONDER_INACTIVE_PRESS_OUT\n  | typeof States.RESPONDER_ACTIVE_PRESS_IN\n  | typeof States.RESPONDER_ACTIVE_PRESS_OUT\n  | typeof States.RESPONDER_ACTIVE_LONG_PRESS_IN\n  | typeof States.RESPONDER_ACTIVE_LONG_PRESS_OUT\n  | typeof States.ERROR;\n\n/*\n * Quick lookup map for states that are considered to be \"active\"\n */\n\nconst baseStatesConditions = {\n  NOT_RESPONDER: false,\n  RESPONDER_INACTIVE_PRESS_IN: false,\n  RESPONDER_INACTIVE_PRESS_OUT: false,\n  RESPONDER_ACTIVE_PRESS_IN: false,\n  RESPONDER_ACTIVE_PRESS_OUT: false,\n  RESPONDER_ACTIVE_LONG_PRESS_IN: false,\n  RESPONDER_ACTIVE_LONG_PRESS_OUT: false,\n  ERROR: false\n};\n\nconst IsActive = {\n  ...baseStatesConditions,\n  RESPONDER_ACTIVE_PRESS_OUT: true,\n  RESPONDER_ACTIVE_PRESS_IN: true\n};\n\n/**\n * Quick lookup for states that are considered to be \"pressing\" and are\n * therefore eligible to result in a \"selection\" if the press stops.\n */\nconst IsPressingIn = {\n  ...baseStatesConditions,\n  RESPONDER_INACTIVE_PRESS_IN: true,\n  RESPONDER_ACTIVE_PRESS_IN: true,\n  RESPONDER_ACTIVE_LONG_PRESS_IN: true\n};\n\nconst IsLongPressingIn = {\n  ...baseStatesConditions,\n  RESPONDER_ACTIVE_LONG_PRESS_IN: true\n};\n\n/**\n * Inputs to the state machine.\n */\nconst Signals = {\n  DELAY: 'DELAY',\n  RESPONDER_GRANT: 'RESPONDER_GRANT',\n  RESPONDER_RELEASE: 'RESPONDER_RELEASE',\n  RESPONDER_TERMINATED: 'RESPONDER_TERMINATED',\n  ENTER_PRESS_RECT: 'ENTER_PRESS_RECT',\n  LEAVE_PRESS_RECT: 'LEAVE_PRESS_RECT',\n  LONG_PRESS_DETECTED: 'LONG_PRESS_DETECTED'\n};\n\ntype Signal =\n  | typeof Signals.DELAY\n  | typeof Signals.RESPONDER_GRANT\n  | typeof Signals.RESPONDER_RELEASE\n  | typeof Signals.RESPONDER_TERMINATED\n  | typeof Signals.ENTER_PRESS_RECT\n  | typeof Signals.LEAVE_PRESS_RECT\n  | typeof Signals.LONG_PRESS_DETECTED;\n\n/**\n * Mapping from States x Signals => States\n */\nconst Transitions = {\n  NOT_RESPONDER: {\n    DELAY: States.ERROR,\n    RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN,\n    RESPONDER_RELEASE: States.ERROR,\n    RESPONDER_TERMINATED: States.ERROR,\n    ENTER_PRESS_RECT: States.ERROR,\n    LEAVE_PRESS_RECT: States.ERROR,\n    LONG_PRESS_DETECTED: States.ERROR\n  },\n  RESPONDER_INACTIVE_PRESS_IN: {\n    DELAY: States.RESPONDER_ACTIVE_PRESS_IN,\n    RESPONDER_GRANT: States.ERROR,\n    RESPONDER_RELEASE: States.NOT_RESPONDER,\n    RESPONDER_TERMINATED: States.NOT_RESPONDER,\n    ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN,\n    LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT,\n    LONG_PRESS_DETECTED: States.ERROR\n  },\n  RESPONDER_INACTIVE_PRESS_OUT: {\n    DELAY: States.RESPONDER_ACTIVE_PRESS_OUT,\n    RESPONDER_GRANT: States.ERROR,\n    RESPONDER_RELEASE: States.NOT_RESPONDER,\n    RESPONDER_TERMINATED: States.NOT_RESPONDER,\n    ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN,\n    LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT,\n    LONG_PRESS_DETECTED: States.ERROR\n  },\n  RESPONDER_ACTIVE_PRESS_IN: {\n    DELAY: States.ERROR,\n    RESPONDER_GRANT: States.ERROR,\n    RESPONDER_RELEASE: States.NOT_RESPONDER,\n    RESPONDER_TERMINATED: States.NOT_RESPONDER,\n    ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN,\n    LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT,\n    LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN\n  },\n  RESPONDER_ACTIVE_PRESS_OUT: {\n    DELAY: States.ERROR,\n    RESPONDER_GRANT: States.ERROR,\n    RESPONDER_RELEASE: States.NOT_RESPONDER,\n    RESPONDER_TERMINATED: States.NOT_RESPONDER,\n    ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN,\n    LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT,\n    LONG_PRESS_DETECTED: States.ERROR\n  },\n  RESPONDER_ACTIVE_LONG_PRESS_IN: {\n    DELAY: States.ERROR,\n    RESPONDER_GRANT: States.ERROR,\n    RESPONDER_RELEASE: States.NOT_RESPONDER,\n    RESPONDER_TERMINATED: States.NOT_RESPONDER,\n    ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN,\n    LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT,\n    LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN\n  },\n  RESPONDER_ACTIVE_LONG_PRESS_OUT: {\n    DELAY: States.ERROR,\n    RESPONDER_GRANT: States.ERROR,\n    RESPONDER_RELEASE: States.NOT_RESPONDER,\n    RESPONDER_TERMINATED: States.NOT_RESPONDER,\n    ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN,\n    LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT,\n    LONG_PRESS_DETECTED: States.ERROR\n  },\n  error: {\n    DELAY: States.NOT_RESPONDER,\n    RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN,\n    RESPONDER_RELEASE: States.NOT_RESPONDER,\n    RESPONDER_TERMINATED: States.NOT_RESPONDER,\n    ENTER_PRESS_RECT: States.NOT_RESPONDER,\n    LEAVE_PRESS_RECT: States.NOT_RESPONDER,\n    LONG_PRESS_DETECTED: States.NOT_RESPONDER\n  }\n};\n\n// ==== Typical Constants for integrating into UI components ====\n// var HIT_EXPAND_PX = 20;\n// var HIT_VERT_OFFSET_PX = 10;\nconst HIGHLIGHT_DELAY_MS = 130;\n\nconst PRESS_EXPAND_PX = 20;\n\nconst LONG_PRESS_THRESHOLD = 500;\n\nconst LONG_PRESS_DELAY_MS = LONG_PRESS_THRESHOLD - HIGHLIGHT_DELAY_MS;\n\nconst LONG_PRESS_ALLOWED_MOVEMENT = 10;\n\n// Default amount \"active\" region protrudes beyond box\n\n/**\n * By convention, methods prefixed with underscores are meant to be @private,\n * and not @protected. Mixers shouldn't access them - not even to provide them\n * as callback handlers.\n *\n *\n * ========== Geometry =========\n * `Touchable` only assumes that there exists a `HitRect` node. The `PressRect`\n * is an abstract box that is extended beyond the `HitRect`.\n *\n *  +--------------------------+\n *  |                          | - \"Start\" events in `HitRect` cause `HitRect`\n *  |  +--------------------+  |   to become the responder.\n *  |  |  +--------------+  |  | - `HitRect` is typically expanded around\n *  |  |  |              |  |  |   the `VisualRect`, but shifted downward.\n *  |  |  |  VisualRect  |  |  | - After pressing down, after some delay,\n *  |  |  |              |  |  |   and before letting up, the Visual React\n *  |  |  +--------------+  |  |   will become \"active\". This makes it eligible\n *  |  |     HitRect        |  |   for being highlighted (so long as the\n *  |  +--------------------+  |   press remains in the `PressRect`).\n *  |        PressRect     o   |\n *  +----------------------|---+\n *           Out Region    |\n *                         +-----+ This gap between the `HitRect` and\n *                                 `PressRect` allows a touch to move far away\n *                                 from the original hit rect, and remain\n *                                 highlighted, and eligible for a \"Press\".\n *                                 Customize this via\n *                                 `touchableGetPressRectOffset()`.\n *\n *\n *\n * ======= State Machine =======\n *\n * +-------------+ <---+ RESPONDER_RELEASE\n * |NOT_RESPONDER|\n * +-------------+ <---+ RESPONDER_TERMINATED\n *     +\n *     | RESPONDER_GRANT (HitRect)\n *     v\n * +---------------------------+  DELAY   +-------------------------+  T + DELAY     +------------------------------+\n * |RESPONDER_INACTIVE_PRESS_IN|+-------->|RESPONDER_ACTIVE_PRESS_IN| +------------> |RESPONDER_ACTIVE_LONG_PRESS_IN|\n * +---------------------------+          +-------------------------+                +------------------------------+\n *     +            ^                         +           ^                                 +           ^\n *     |LEAVE_      |ENTER_                   |LEAVE_     |ENTER_                           |LEAVE_     |ENTER_\n *     |PRESS_RECT  |PRESS_RECT               |PRESS_RECT |PRESS_RECT                       |PRESS_RECT |PRESS_RECT\n *     |            |                         |           |                                 |           |\n *     v            +                         v           +                                 v           +\n * +----------------------------+  DELAY  +--------------------------+               +-------------------------------+\n * |RESPONDER_INACTIVE_PRESS_OUT|+------->|RESPONDER_ACTIVE_PRESS_OUT|               |RESPONDER_ACTIVE_LONG_PRESS_OUT|\n * +----------------------------+         +--------------------------+               +-------------------------------+\n *\n * T + DELAY => LONG_PRESS_DELAY_MS + DELAY\n *\n * Not drawn are the side effects of each transition. The most important side\n * effect is the `touchableHandlePress` abstract method invocation that occurs\n * when a responder is released while in either of the \"Press\" states.\n *\n * The other important side effects are the highlight abstract method\n * invocations (internal callbacks) to be implemented by the mixer.\n *\n *\n * @lends Touchable.prototype\n */\nconst TouchableMixin = {\n  // HACK (part 1): basic support for touchable interactions using a keyboard\n  componentDidMount: function () {\n    warnOnce(\n      'TouchableMixin',\n      'TouchableMixin is deprecated. Please use Pressable.'\n    );\n\n    const touchableNode = this.getTouchableNode && this.getTouchableNode();\n    if (touchableNode && touchableNode.addEventListener) {\n      this._touchableBlurListener = (e) => {\n        if (this._isTouchableKeyboardActive) {\n          if (\n            this.state.touchable.touchState &&\n            this.state.touchable.touchState !== States.NOT_RESPONDER\n          ) {\n            this.touchableHandleResponderTerminate({ nativeEvent: e });\n          }\n          this._isTouchableKeyboardActive = false;\n        }\n      };\n      touchableNode.addEventListener('blur', this._touchableBlurListener);\n    }\n  },\n\n  /**\n   * Clear all timeouts on unmount\n   */\n  componentWillUnmount: function () {\n    const touchableNode = this.getTouchableNode && this.getTouchableNode();\n    if (touchableNode && touchableNode.addEventListener) {\n      touchableNode.removeEventListener('blur', this._touchableBlurListener);\n    }\n    this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);\n    this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);\n    this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout);\n    // Clear DOM nodes\n    this.pressInLocation = null;\n    this.state.touchable.responderID = null;\n  },\n\n  /**\n   * It's prefer that mixins determine state in this way, having the class\n   * explicitly mix the state in the one and only `getInitialState` method.\n   *\n   * @return {object} State object to be placed inside of\n   * `this.state.touchable`.\n   */\n  touchableGetInitialState: function (): {|\n    touchable: {| responderID: null, touchState: void |}\n  |} {\n    return {\n      touchable: { touchState: undefined, responderID: null }\n    };\n  },\n\n  // ==== Hooks to Gesture Responder system ====\n  /**\n   * Must return true if embedded in a native platform scroll view.\n   */\n  touchableHandleResponderTerminationRequest: function (): boolean {\n    return !this.props.rejectResponderTermination;\n  },\n\n  /**\n   * Must return true to start the process of `Touchable`.\n   */\n  touchableHandleStartShouldSetResponder: function (): boolean {\n    return !this.props.disabled;\n  },\n\n  /**\n   * Return true to cancel press on long press.\n   */\n  touchableLongPressCancelsPress: function (): boolean {\n    return true;\n  },\n\n  /**\n   * Place as callback for a DOM element's `onResponderGrant` event.\n   * @param {SyntheticEvent} e Synthetic event from event system.\n   *\n   */\n  touchableHandleResponderGrant: function (e: PressEvent) {\n    const dispatchID = e.currentTarget;\n    // Since e is used in a callback invoked on another event loop\n    // (as in setTimeout etc), we need to call e.persist() on the\n    // event to make sure it doesn't get reused in the event object pool.\n    e.persist();\n\n    this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout);\n    this.pressOutDelayTimeout = null;\n\n    this.state.touchable.touchState = States.NOT_RESPONDER;\n    this.state.touchable.responderID = dispatchID;\n    this._receiveSignal(Signals.RESPONDER_GRANT, e);\n    let delayMS =\n      this.touchableGetHighlightDelayMS !== undefined\n        ? Math.max(this.touchableGetHighlightDelayMS(), 0)\n        : HIGHLIGHT_DELAY_MS;\n    delayMS = isNaN(delayMS) ? HIGHLIGHT_DELAY_MS : delayMS;\n    if (delayMS !== 0) {\n      this.touchableDelayTimeout = setTimeout(\n        this._handleDelay.bind(this, e),\n        delayMS\n      );\n    } else {\n      this._handleDelay(e);\n    }\n\n    let longDelayMS =\n      this.touchableGetLongPressDelayMS !== undefined\n        ? Math.max(this.touchableGetLongPressDelayMS(), 10)\n        : LONG_PRESS_DELAY_MS;\n    longDelayMS = isNaN(longDelayMS) ? LONG_PRESS_DELAY_MS : longDelayMS;\n    this.longPressDelayTimeout = setTimeout(\n      this._handleLongDelay.bind(this, e),\n      longDelayMS + delayMS\n    );\n  },\n\n  /**\n   * Place as callback for a DOM element's `onResponderRelease` event.\n   */\n  touchableHandleResponderRelease: function (e: PressEvent) {\n    this.pressInLocation = null;\n    this._receiveSignal(Signals.RESPONDER_RELEASE, e);\n  },\n\n  /**\n   * Place as callback for a DOM element's `onResponderTerminate` event.\n   */\n  touchableHandleResponderTerminate: function (e: PressEvent) {\n    this.pressInLocation = null;\n    this._receiveSignal(Signals.RESPONDER_TERMINATED, e);\n  },\n\n  /**\n   * Place as callback for a DOM element's `onResponderMove` event.\n   */\n  touchableHandleResponderMove: function (e: PressEvent) {\n    // Measurement may not have returned yet.\n    if (!this.state.touchable.positionOnActivate) {\n      return;\n    }\n\n    const positionOnActivate = this.state.touchable.positionOnActivate;\n    const dimensionsOnActivate = this.state.touchable.dimensionsOnActivate;\n    const pressRectOffset = this.touchableGetPressRectOffset\n      ? this.touchableGetPressRectOffset()\n      : {\n          left: PRESS_EXPAND_PX,\n          right: PRESS_EXPAND_PX,\n          top: PRESS_EXPAND_PX,\n          bottom: PRESS_EXPAND_PX\n        };\n\n    let pressExpandLeft = pressRectOffset.left;\n    let pressExpandTop = pressRectOffset.top;\n    let pressExpandRight = pressRectOffset.right;\n    let pressExpandBottom = pressRectOffset.bottom;\n\n    const hitSlop = this.touchableGetHitSlop\n      ? this.touchableGetHitSlop()\n      : null;\n\n    if (hitSlop) {\n      pressExpandLeft += hitSlop.left || 0;\n      pressExpandTop += hitSlop.top || 0;\n      pressExpandRight += hitSlop.right || 0;\n      pressExpandBottom += hitSlop.bottom || 0;\n    }\n\n    const touch = extractSingleTouch(e.nativeEvent);\n    const pageX = touch && touch.pageX;\n    const pageY = touch && touch.pageY;\n\n    if (this.pressInLocation) {\n      const movedDistance = this._getDistanceBetweenPoints(\n        pageX,\n        pageY,\n        this.pressInLocation.pageX,\n        this.pressInLocation.pageY\n      );\n      if (movedDistance > LONG_PRESS_ALLOWED_MOVEMENT) {\n        this._cancelLongPressDelayTimeout();\n      }\n    }\n\n    const isTouchWithinActive =\n      pageX > positionOnActivate.left - pressExpandLeft &&\n      pageY > positionOnActivate.top - pressExpandTop &&\n      pageX <\n        positionOnActivate.left +\n          dimensionsOnActivate.width +\n          pressExpandRight &&\n      pageY <\n        positionOnActivate.top +\n          dimensionsOnActivate.height +\n          pressExpandBottom;\n    if (isTouchWithinActive) {\n      const prevState = this.state.touchable.touchState;\n      this._receiveSignal(Signals.ENTER_PRESS_RECT, e);\n      const curState = this.state.touchable.touchState;\n      if (\n        curState === States.RESPONDER_INACTIVE_PRESS_IN &&\n        prevState !== States.RESPONDER_INACTIVE_PRESS_IN\n      ) {\n        // fix for t7967420\n        this._cancelLongPressDelayTimeout();\n      }\n    } else {\n      this._cancelLongPressDelayTimeout();\n      this._receiveSignal(Signals.LEAVE_PRESS_RECT, e);\n    }\n  },\n\n  /**\n   * Invoked when the item receives focus. Mixers might override this to\n   * visually distinguish the `VisualRect` so that the user knows that it\n   * currently has the focus. Most platforms only support a single element being\n   * focused at a time, in which case there may have been a previously focused\n   * element that was blurred just prior to this. This can be overridden when\n   * using `Touchable.Mixin.withoutDefaultFocusAndBlur`.\n   */\n  touchableHandleFocus: function (e: Event) {\n    this.props.onFocus && this.props.onFocus(e);\n  },\n\n  /**\n   * Invoked when the item loses focus. Mixers might override this to\n   * visually distinguish the `VisualRect` so that the user knows that it\n   * no longer has focus. Most platforms only support a single element being\n   * focused at a time, in which case the focus may have moved to another.\n   * This can be overridden when using\n   * `Touchable.Mixin.withoutDefaultFocusAndBlur`.\n   */\n  touchableHandleBlur: function (e: Event) {\n    this.props.onBlur && this.props.onBlur(e);\n  },\n\n  // ==== Abstract Application Callbacks ====\n\n  /**\n   * Invoked when the item should be highlighted. Mixers should implement this\n   * to visually distinguish the `VisualRect` so that the user knows that\n   * releasing a touch will result in a \"selection\" (analog to click).\n   *\n   * @abstract\n   * touchableHandleActivePressIn: function,\n   */\n\n  /**\n   * Invoked when the item is \"active\" (in that it is still eligible to become\n   * a \"select\") but the touch has left the `PressRect`. Usually the mixer will\n   * want to unhighlight the `VisualRect`. If the user (while pressing) moves\n   * back into the `PressRect` `touchableHandleActivePressIn` will be invoked\n   * again and the mixer should probably highlight the `VisualRect` again. This\n   * event will not fire on an `touchEnd/mouseUp` event, only move events while\n   * the user is depressing the mouse/touch.\n   *\n   * @abstract\n   * touchableHandleActivePressOut: function\n   */\n\n  /**\n   * Invoked when the item is \"selected\" - meaning the interaction ended by\n   * letting up while the item was either in the state\n   * `RESPONDER_ACTIVE_PRESS_IN` or `RESPONDER_INACTIVE_PRESS_IN`.\n   *\n   * @abstract\n   * touchableHandlePress: function\n   */\n\n  /**\n   * Invoked when the item is long pressed - meaning the interaction ended by\n   * letting up while the item was in `RESPONDER_ACTIVE_LONG_PRESS_IN`. If\n   * `touchableHandleLongPress` is *not* provided, `touchableHandlePress` will\n   * be called as it normally is. If `touchableHandleLongPress` is provided, by\n   * default any `touchableHandlePress` callback will not be invoked. To\n   * override this default behavior, override `touchableLongPressCancelsPress`\n   * to return false. As a result, `touchableHandlePress` will be called when\n   * lifting up, even if `touchableHandleLongPress` has also been called.\n   *\n   * @abstract\n   * touchableHandleLongPress: function\n   */\n\n  /**\n   * Returns the number of millis to wait before triggering a highlight.\n   *\n   * @abstract\n   * touchableGetHighlightDelayMS: function\n   */\n\n  /**\n   * Returns the amount to extend the `HitRect` into the `PressRect`. Positive\n   * numbers mean the size expands outwards.\n   *\n   * @abstract\n   * touchableGetPressRectOffset: function\n   */\n\n  // ==== Internal Logic ====\n\n  /**\n   * Measures the `HitRect` node on activation. The Bounding rectangle is with\n   * respect to viewport - not page, so adding the `pageXOffset/pageYOffset`\n   * should result in points that are in the same coordinate system as an\n   * event's `globalX/globalY` data values.\n   *\n   * - Consider caching this for the lifetime of the component, or possibly\n   *   being able to share this cache between any `ScrollMap` view.\n   *\n   * @sideeffects\n   * @private\n   */\n  _remeasureMetricsOnActivation: function () {\n    const tag = this.state.touchable.responderID;\n    if (tag == null) {\n      return;\n    }\n\n    UIManager.measure(tag, this._handleQueryLayout);\n  },\n\n  _handleQueryLayout: function (\n    l: number,\n    t: number,\n    w: number,\n    h: number,\n    globalX: number,\n    globalY: number\n  ) {\n    //don't do anything UIManager failed to measure node\n    if (!l && !t && !w && !h && !globalX && !globalY) {\n      return;\n    }\n    this.state.touchable.positionOnActivate &&\n      Position.release(this.state.touchable.positionOnActivate);\n    this.state.touchable.dimensionsOnActivate &&\n      // $FlowFixMe\n      BoundingDimensions.release(this.state.touchable.dimensionsOnActivate);\n    this.state.touchable.positionOnActivate = Position.getPooled(\n      globalX,\n      globalY\n    );\n    // $FlowFixMe\n    this.state.touchable.dimensionsOnActivate = BoundingDimensions.getPooled(\n      w,\n      h\n    );\n  },\n\n  _handleDelay: function (e: PressEvent) {\n    this.touchableDelayTimeout = null;\n    this._receiveSignal(Signals.DELAY, e);\n  },\n\n  _handleLongDelay: function (e: PressEvent) {\n    this.longPressDelayTimeout = null;\n    const curState = this.state.touchable.touchState;\n    if (\n      curState !== States.RESPONDER_ACTIVE_PRESS_IN &&\n      curState !== States.RESPONDER_ACTIVE_LONG_PRESS_IN\n    ) {\n      console.error(\n        'Attempted to transition from state `' +\n          curState +\n          '` to `' +\n          States.RESPONDER_ACTIVE_LONG_PRESS_IN +\n          '`, which is not supported. This is ' +\n          'most likely due to `Touchable.longPressDelayTimeout` not being cancelled.'\n      );\n    } else {\n      this._receiveSignal(Signals.LONG_PRESS_DETECTED, e);\n    }\n  },\n\n  /**\n   * Receives a state machine signal, performs side effects of the transition\n   * and stores the new state. Validates the transition as well.\n   *\n   * @param {Signals} signal State machine signal.\n   * @throws Error if invalid state transition or unrecognized signal.\n   * @sideeffects\n   */\n  _receiveSignal: function (signal: Signal, e: PressEvent) {\n    const responderID = this.state.touchable.responderID;\n    const curState = this.state.touchable.touchState;\n    const nextState = Transitions[curState] && Transitions[curState][signal];\n    if (!responderID && signal === Signals.RESPONDER_RELEASE) {\n      return;\n    }\n    if (!nextState) {\n      throw new Error(\n        'Unrecognized signal `' +\n          signal +\n          '` or state `' +\n          curState +\n          '` for Touchable responder `' +\n          responderID +\n          '`'\n      );\n    }\n    if (nextState === States.ERROR) {\n      throw new Error(\n        'Touchable cannot transition from `' +\n          curState +\n          '` to `' +\n          signal +\n          '` for responder `' +\n          responderID +\n          '`'\n      );\n    }\n    if (curState !== nextState) {\n      this._performSideEffectsForTransition(curState, nextState, signal, e);\n      this.state.touchable.touchState = nextState;\n    }\n  },\n\n  _cancelLongPressDelayTimeout: function () {\n    this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);\n    this.longPressDelayTimeout = null;\n  },\n\n  _isHighlight: function (state: State): boolean {\n    return (\n      state === States.RESPONDER_ACTIVE_PRESS_IN ||\n      state === States.RESPONDER_ACTIVE_LONG_PRESS_IN\n    );\n  },\n\n  _savePressInLocation: function (e: PressEvent) {\n    const touch = extractSingleTouch(e.nativeEvent);\n    const pageX = touch && touch.pageX;\n    const pageY = touch && touch.pageY;\n    const locationX = touch && touch.locationX;\n    const locationY = touch && touch.locationY;\n    this.pressInLocation = { pageX, pageY, locationX, locationY };\n  },\n\n  _getDistanceBetweenPoints: function (\n    aX: number,\n    aY: number,\n    bX: number,\n    bY: number\n  ): number {\n    const deltaX = aX - bX;\n    const deltaY = aY - bY;\n    return Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n  },\n\n  /**\n   * Will perform a transition between touchable states, and identify any\n   * highlighting or unhighlighting that must be performed for this particular\n   * transition.\n   *\n   * @param {States} curState Current Touchable state.\n   * @param {States} nextState Next Touchable state.\n   * @param {Signal} signal Signal that triggered the transition.\n   * @param {Event} e Native event.\n   * @sideeffects\n   */\n  _performSideEffectsForTransition: function (\n    curState: State,\n    nextState: State,\n    signal: Signal,\n    e: PressEvent\n  ) {\n    const curIsHighlight = this._isHighlight(curState);\n    const newIsHighlight = this._isHighlight(nextState);\n\n    const isFinalSignal =\n      signal === Signals.RESPONDER_TERMINATED ||\n      signal === Signals.RESPONDER_RELEASE;\n\n    if (isFinalSignal) {\n      this._cancelLongPressDelayTimeout();\n    }\n\n    const isInitialTransition =\n      curState === States.NOT_RESPONDER &&\n      nextState === States.RESPONDER_INACTIVE_PRESS_IN;\n\n    const isActiveTransition = !IsActive[curState] && IsActive[nextState];\n    if (isInitialTransition || isActiveTransition) {\n      this._remeasureMetricsOnActivation();\n    }\n\n    if (IsPressingIn[curState] && signal === Signals.LONG_PRESS_DETECTED) {\n      this.touchableHandleLongPress && this.touchableHandleLongPress(e);\n    }\n\n    if (newIsHighlight && !curIsHighlight) {\n      this._startHighlight(e);\n    } else if (!newIsHighlight && curIsHighlight) {\n      this._endHighlight(e);\n    }\n\n    if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) {\n      const hasLongPressHandler = !!this.props.onLongPress;\n      const pressIsLongButStillCallOnPress =\n        IsLongPressingIn[curState] && // We *are* long pressing.. // But either has no long handler\n        (!hasLongPressHandler || !this.touchableLongPressCancelsPress()); // or we're told to ignore it.\n\n      const shouldInvokePress =\n        !IsLongPressingIn[curState] || pressIsLongButStillCallOnPress;\n      if (shouldInvokePress && this.touchableHandlePress) {\n        if (!newIsHighlight && !curIsHighlight) {\n          // we never highlighted because of delay, but we should highlight now\n          this._startHighlight(e);\n          this._endHighlight(e);\n        }\n        this.touchableHandlePress(e);\n      }\n    }\n\n    this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);\n    this.touchableDelayTimeout = null;\n  },\n\n  _playTouchSound: function () {\n    UIManager.playTouchSound();\n  },\n\n  _startHighlight: function (e: PressEvent) {\n    this._savePressInLocation(e);\n    this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e);\n  },\n\n  _endHighlight: function (e: PressEvent) {\n    if (this.touchableHandleActivePressOut) {\n      if (\n        this.touchableGetPressOutDelayMS &&\n        this.touchableGetPressOutDelayMS()\n      ) {\n        this.pressOutDelayTimeout = setTimeout(() => {\n          this.touchableHandleActivePressOut(e);\n        }, this.touchableGetPressOutDelayMS());\n      } else {\n        this.touchableHandleActivePressOut(e);\n      }\n    }\n  },\n\n  // HACK (part 2): basic support for touchable interactions using a keyboard (including\n  // delays and longPress)\n  touchableHandleKeyEvent: function (e: Event) {\n    const { type, key } = e;\n    if (key === 'Enter' || key === ' ') {\n      if (type === 'keydown') {\n        if (!this._isTouchableKeyboardActive) {\n          if (\n            !this.state.touchable.touchState ||\n            this.state.touchable.touchState === States.NOT_RESPONDER\n          ) {\n            this.touchableHandleResponderGrant(e);\n            this._isTouchableKeyboardActive = true;\n          }\n        }\n      } else if (type === 'keyup') {\n        if (this._isTouchableKeyboardActive) {\n          if (\n            this.state.touchable.touchState &&\n            this.state.touchable.touchState !== States.NOT_RESPONDER\n          ) {\n            this.touchableHandleResponderRelease(e);\n            this._isTouchableKeyboardActive = false;\n          }\n        }\n      }\n      e.stopPropagation();\n      // prevent the default behaviour unless the Touchable functions as a link\n      // and Enter is pressed\n      if (\n        !(\n          key === 'Enter' &&\n          AccessibilityUtil.propsToAriaRole(this.props) === 'link'\n        )\n      ) {\n        e.preventDefault();\n      }\n    }\n  },\n\n  withoutDefaultFocusAndBlur: ({}: { ... })\n};\n\n/**\n * Provide an optional version of the mixin where `touchableHandleFocus` and\n * `touchableHandleBlur` can be overridden. This allows appropriate defaults to\n * be set on TV platforms, without breaking existing implementations of\n * `Touchable`.\n */\nconst {\n  // eslint-disable-next-line no-unused-vars\n  touchableHandleFocus,\n  // eslint-disable-next-line no-unused-vars\n  touchableHandleBlur,\n  ...TouchableMixinWithoutDefaultFocusAndBlur\n} = TouchableMixin;\nTouchableMixin.withoutDefaultFocusAndBlur =\n  TouchableMixinWithoutDefaultFocusAndBlur;\n\nconst Touchable = {\n  Mixin: TouchableMixin,\n  TOUCH_TARGET_DEBUG: false, // Highlights all touchable targets. Toggle with Inspector.\n  /**\n   * Renders a debugging overlay to visualize touch target with hitSlop (might not work on Android).\n   */\n  renderDebugView: ({\n    color,\n    hitSlop\n  }: {\n    color: string | number,\n    hitSlop: EdgeInsetsProp\n  }): Node => {\n    if (!Touchable.TOUCH_TARGET_DEBUG) {\n      return null;\n    }\n    if (process.env.NODE_ENV !== 'production') {\n      throw Error(\n        'Touchable.TOUCH_TARGET_DEBUG should not be enabled in prod!'\n      );\n    }\n    const debugHitSlopStyle = {};\n    hitSlop = hitSlop || { top: 0, bottom: 0, left: 0, right: 0 };\n    for (const key in hitSlop) {\n      debugHitSlopStyle[key] = -hitSlop[key];\n    }\n    const normalizedColor = normalizeColor(color);\n    if (typeof normalizedColor !== 'number') {\n      return null;\n    }\n    const hexColor =\n      '#' + ('00000000' + normalizedColor.toString(16)).substr(-8);\n    return (\n      <View\n        pointerEvents=\"none\"\n        style={{\n          position: 'absolute',\n          borderColor: hexColor.slice(0, -2) + '55', // More opaque\n          borderWidth: 1,\n          borderStyle: 'dashed',\n          backgroundColor: hexColor.slice(0, -2) + '0F', // Less opaque\n          ...debugHitSlopStyle\n        }}\n      />\n    );\n  }\n};\n\nexport default Touchable;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/TouchableHighlight/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\n'use client';\n\nimport type { ColorValue } from '../../types';\nimport type { Props as TouchableWithoutFeedbackProps } from '../TouchableWithoutFeedback';\nimport type { ViewProps } from '../View';\n\nimport * as React from 'react';\nimport { useCallback, useMemo, useState, useRef } from 'react';\nimport useMergeRefs from '../../modules/useMergeRefs';\nimport usePressEvents from '../../modules/usePressEvents';\nimport StyleSheet from '../StyleSheet';\nimport View from '../View';\n//import { warnOnce } from '../../modules/warnOnce';\n\ntype ViewStyle = $PropertyType<ViewProps, 'style'>;\n\ntype Props = $ReadOnly<{|\n  ...TouchableWithoutFeedbackProps,\n  activeOpacity?: ?number,\n  onHideUnderlay?: ?() => void,\n  onShowUnderlay?: ?() => void,\n  style?: ViewStyle,\n  testOnly_pressed?: ?boolean,\n  underlayColor?: ?ColorValue\n|}>;\n\ntype ExtraStyles = $ReadOnly<{|\n  child: ViewStyle,\n  underlay: ViewStyle\n|}>;\n\nfunction createExtraStyles(activeOpacity, underlayColor): ExtraStyles {\n  return {\n    child: { opacity: activeOpacity ?? 0.85 },\n    underlay: {\n      backgroundColor: underlayColor === undefined ? 'black' : underlayColor\n    }\n  };\n}\n\nfunction hasPressHandler(props): boolean {\n  return (\n    props.onPress != null ||\n    props.onPressIn != null ||\n    props.onPressOut != null ||\n    props.onLongPress != null\n  );\n}\n\n/**\n * A wrapper for making views respond properly to touches.\n * On press down, the opacity of the wrapped view is decreased, which allows\n * the underlay color to show through, darkening or tinting the view.\n *\n * The underlay comes from wrapping the child in a new View, which can affect\n * layout, and sometimes cause unwanted visual artifacts if not used correctly,\n * for example if the backgroundColor of the wrapped view isn't explicitly set\n * to an opaque color.\n *\n * TouchableHighlight must have one child (not zero or more than one).\n * If you wish to have several child components, wrap them in a View.\n */\nfunction TouchableHighlight(props: Props, forwardedRef): React.Node {\n  /*\n  warnOnce(\n    'TouchableHighlight',\n    'TouchableHighlight is deprecated. Please use Pressable.'\n  );\n  */\n\n  const {\n    activeOpacity,\n    children,\n    delayPressIn,\n    delayPressOut,\n    delayLongPress,\n    disabled,\n    focusable,\n    onHideUnderlay,\n    onLongPress,\n    onPress,\n    onPressIn,\n    onPressOut,\n    onShowUnderlay,\n    rejectResponderTermination,\n    style,\n    testOnly_pressed,\n    underlayColor,\n    ...rest\n  } = props;\n\n  const hostRef = useRef(null);\n  const setRef = useMergeRefs(forwardedRef, hostRef);\n\n  const [extraStyles, setExtraStyles] = useState(\n    testOnly_pressed === true\n      ? createExtraStyles(activeOpacity, underlayColor)\n      : null\n  );\n\n  const showUnderlay = useCallback(() => {\n    if (!hasPressHandler(props)) {\n      return;\n    }\n    setExtraStyles(createExtraStyles(activeOpacity, underlayColor));\n    if (onShowUnderlay != null) {\n      onShowUnderlay();\n    }\n  }, [activeOpacity, onShowUnderlay, props, underlayColor]);\n\n  const hideUnderlay = useCallback(() => {\n    if (testOnly_pressed === true) {\n      return;\n    }\n    if (hasPressHandler(props)) {\n      setExtraStyles(null);\n      if (onHideUnderlay != null) {\n        onHideUnderlay();\n      }\n    }\n  }, [onHideUnderlay, props, testOnly_pressed]);\n\n  const pressConfig = useMemo(\n    () => ({\n      cancelable: !rejectResponderTermination,\n      disabled,\n      delayLongPress,\n      delayPressStart: delayPressIn,\n      delayPressEnd: delayPressOut,\n      onLongPress,\n      onPress,\n      onPressStart(event) {\n        showUnderlay();\n        if (onPressIn != null) {\n          onPressIn(event);\n        }\n      },\n      onPressEnd(event) {\n        hideUnderlay();\n        if (onPressOut != null) {\n          onPressOut(event);\n        }\n      }\n    }),\n    [\n      delayLongPress,\n      delayPressIn,\n      delayPressOut,\n      disabled,\n      onLongPress,\n      onPress,\n      onPressIn,\n      onPressOut,\n      rejectResponderTermination,\n      showUnderlay,\n      hideUnderlay\n    ]\n  );\n\n  const pressEventHandlers = usePressEvents(hostRef, pressConfig);\n\n  const child = React.Children.only(children);\n\n  return (\n    <View\n      {...rest}\n      {...pressEventHandlers}\n      accessibilityDisabled={disabled}\n      focusable={!disabled && focusable !== false}\n      pointerEvents={disabled ? 'box-none' : undefined}\n      ref={setRef}\n      style={[\n        styles.root,\n        style,\n        !disabled && styles.actionable,\n        extraStyles && extraStyles.underlay\n      ]}\n    >\n      {React.cloneElement(child, {\n        style: [child.props.style, extraStyles && extraStyles.child]\n      })}\n    </View>\n  );\n}\n\nconst styles = StyleSheet.create({\n  root: {\n    userSelect: 'none'\n  },\n  actionable: {\n    cursor: 'pointer',\n    touchAction: 'manipulation'\n  }\n});\n\nconst MemoedTouchableHighlight = React.memo(\n  React.forwardRef(TouchableHighlight)\n);\nMemoedTouchableHighlight.displayName = 'TouchableHighlight';\n\nexport default (MemoedTouchableHighlight: React.AbstractComponent<\n  Props,\n  React.ElementRef<typeof View>\n>);\n"
  },
  {
    "path": "packages/react-native-web/src/exports/TouchableNativeFeedback/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nimport UnimplementedView from '../../modules/UnimplementedView';\nexport default UnimplementedView;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/TouchableOpacity/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\n'use client';\n\nimport type { Props as TouchableWithoutFeedbackProps } from '../TouchableWithoutFeedback';\nimport type { ViewProps } from '../View';\n\nimport * as React from 'react';\nimport { useCallback, useMemo, useState, useRef } from 'react';\nimport useMergeRefs from '../../modules/useMergeRefs';\nimport usePressEvents from '../../modules/usePressEvents';\nimport StyleSheet from '../StyleSheet';\nimport View from '../View';\n//import { warnOnce } from '../../modules/warnOnce';\n\ntype ViewStyle = $PropertyType<ViewProps, 'style'>;\n\ntype Props = $ReadOnly<{|\n  ...TouchableWithoutFeedbackProps,\n  activeOpacity?: ?number,\n  style?: ?ViewStyle\n|}>;\n\n/**\n * A wrapper for making views respond properly to touches.\n * On press down, the opacity of the wrapped view is decreased, dimming it.\n */\nfunction TouchableOpacity(props: Props, forwardedRef): React.Node {\n  /*\n  warnOnce(\n    'TouchableOpacity',\n    'TouchableOpacity is deprecated. Please use Pressable.'\n  );\n  */\n\n  const {\n    activeOpacity,\n    delayPressIn,\n    delayPressOut,\n    delayLongPress,\n    disabled,\n    focusable,\n    onLongPress,\n    onPress,\n    onPressIn,\n    onPressOut,\n    rejectResponderTermination,\n    style,\n    ...rest\n  } = props;\n\n  const hostRef = useRef(null);\n  const setRef = useMergeRefs(forwardedRef, hostRef);\n\n  const [duration, setDuration] = useState('0s');\n  const [opacityOverride, setOpacityOverride] = useState(null);\n\n  const setOpacityTo = useCallback(\n    (value: ?number, duration: number) => {\n      setOpacityOverride(value);\n      setDuration(duration ? `${duration / 1000}s` : '0s');\n    },\n    [setOpacityOverride, setDuration]\n  );\n\n  const setOpacityActive = useCallback(\n    (duration: number) => {\n      setOpacityTo(activeOpacity ?? 0.2, duration);\n    },\n    [activeOpacity, setOpacityTo]\n  );\n\n  const setOpacityInactive = useCallback(\n    (duration: number) => {\n      setOpacityTo(null, duration);\n    },\n    [setOpacityTo]\n  );\n\n  const pressConfig = useMemo(\n    () => ({\n      cancelable: !rejectResponderTermination,\n      disabled,\n      delayLongPress,\n      delayPressStart: delayPressIn,\n      delayPressEnd: delayPressOut,\n      onLongPress,\n      onPress,\n      onPressStart(event) {\n        const isGrant =\n          event.dispatchConfig != null\n            ? event.dispatchConfig.registrationName === 'onResponderGrant'\n            : event.type === 'keydown';\n        setOpacityActive(isGrant ? 0 : 150);\n        if (onPressIn != null) {\n          onPressIn(event);\n        }\n      },\n      onPressEnd(event) {\n        setOpacityInactive(250);\n        if (onPressOut != null) {\n          onPressOut(event);\n        }\n      }\n    }),\n    [\n      delayLongPress,\n      delayPressIn,\n      delayPressOut,\n      disabled,\n      onLongPress,\n      onPress,\n      onPressIn,\n      onPressOut,\n      rejectResponderTermination,\n      setOpacityActive,\n      setOpacityInactive\n    ]\n  );\n\n  const pressEventHandlers = usePressEvents(hostRef, pressConfig);\n\n  return (\n    <View\n      {...rest}\n      {...pressEventHandlers}\n      accessibilityDisabled={disabled}\n      focusable={!disabled && focusable !== false}\n      pointerEvents={disabled ? 'box-none' : undefined}\n      ref={setRef}\n      style={[\n        styles.root,\n        !disabled && styles.actionable,\n        style,\n        opacityOverride != null && { opacity: opacityOverride },\n        { transitionDuration: duration }\n      ]}\n    />\n  );\n}\n\nconst styles = StyleSheet.create({\n  root: {\n    transitionProperty: 'opacity',\n    transitionDuration: '0.15s',\n    userSelect: 'none'\n  },\n  actionable: {\n    cursor: 'pointer',\n    touchAction: 'manipulation'\n  }\n});\n\nconst MemoedTouchableOpacity = React.memo(React.forwardRef(TouchableOpacity));\nMemoedTouchableOpacity.displayName = 'TouchableOpacity';\n\nexport default (MemoedTouchableOpacity: React.AbstractComponent<\n  Props,\n  React.ElementRef<typeof View>\n>);\n"
  },
  {
    "path": "packages/react-native-web/src/exports/TouchableWithoutFeedback/__tests__/index-test.js",
    "content": "import React from 'react';\nimport { render } from '@testing-library/react';\nimport TouchableWithoutFeedback from '../';\nimport View from '../../View';\n\ndescribe('components/TouchableWithoutFeedback', () => {\n  test('forwards ref', () => {\n    const ref = jest.fn();\n    render(\n      <TouchableWithoutFeedback ref={ref}>\n        <View />\n      </TouchableWithoutFeedback>\n    );\n    expect(ref).toHaveBeenCalled();\n  });\n\n  test('forwards ref of child', () => {\n    const ref = jest.fn();\n    render(\n      <TouchableWithoutFeedback>\n        <View ref={ref} />\n      </TouchableWithoutFeedback>\n    );\n    expect(ref).toHaveBeenCalled();\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/TouchableWithoutFeedback/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\n'use client';\n\nimport type { PressResponderConfig } from '../../modules/usePressEvents/PressResponder';\nimport type { ViewProps } from '../View';\n\nimport * as React from 'react';\nimport { useMemo, useRef } from 'react';\nimport pick from '../../modules/pick';\nimport useMergeRefs from '../../modules/useMergeRefs';\nimport usePressEvents from '../../modules/usePressEvents';\nimport { warnOnce } from '../../modules/warnOnce';\n\nexport type Props = $ReadOnly<{|\n  accessibilityLabel?: $PropertyType<ViewProps, 'accessibilityLabel'>,\n  accessibilityLiveRegion?: $PropertyType<ViewProps, 'accessibilityLiveRegion'>,\n  accessibilityRole?: $PropertyType<ViewProps, 'accessibilityRole'>,\n  children?: ?React.Node,\n  delayLongPress?: ?number,\n  delayPressIn?: ?number,\n  delayPressOut?: ?number,\n  disabled?: ?boolean,\n  focusable?: ?boolean,\n  nativeID?: $PropertyType<ViewProps, 'nativeID'>,\n  onBlur?: $PropertyType<ViewProps, 'onBlur'>,\n  onFocus?: $PropertyType<ViewProps, 'onFocus'>,\n  onLayout?: $PropertyType<ViewProps, 'onLayout'>,\n  onLongPress?: $PropertyType<PressResponderConfig, 'onLongPress'>,\n  onPress?: $PropertyType<PressResponderConfig, 'onPress'>,\n  onPressIn?: $PropertyType<PressResponderConfig, 'onPressStart'>,\n  onPressOut?: $PropertyType<PressResponderConfig, 'onPressEnd'>,\n  rejectResponderTermination?: ?boolean,\n  testID?: $PropertyType<ViewProps, 'testID'>\n|}>;\n\nconst forwardPropsList = {\n  accessibilityDisabled: true,\n  accessibilityLabel: true,\n  accessibilityLiveRegion: true,\n  accessibilityRole: true,\n  accessibilityState: true,\n  accessibilityValue: true,\n  children: true,\n  disabled: true,\n  focusable: true,\n  nativeID: true,\n  onBlur: true,\n  onFocus: true,\n  onLayout: true,\n  testID: true\n};\n\nconst pickProps = (props) => pick(props, forwardPropsList);\n\nfunction TouchableWithoutFeedback(props: Props, forwardedRef): React.Node {\n  warnOnce(\n    'TouchableWithoutFeedback',\n    'TouchableWithoutFeedback is deprecated. Please use Pressable.'\n  );\n\n  const {\n    delayPressIn,\n    delayPressOut,\n    delayLongPress,\n    disabled,\n    focusable,\n    onLongPress,\n    onPress,\n    onPressIn,\n    onPressOut,\n    rejectResponderTermination\n  } = props;\n\n  const hostRef = useRef(null);\n\n  const pressConfig = useMemo(\n    () => ({\n      cancelable: !rejectResponderTermination,\n      disabled,\n      delayLongPress,\n      delayPressStart: delayPressIn,\n      delayPressEnd: delayPressOut,\n      onLongPress,\n      onPress,\n      onPressStart: onPressIn,\n      onPressEnd: onPressOut\n    }),\n    [\n      disabled,\n      delayPressIn,\n      delayPressOut,\n      delayLongPress,\n      onLongPress,\n      onPress,\n      onPressIn,\n      onPressOut,\n      rejectResponderTermination\n    ]\n  );\n\n  const pressEventHandlers = usePressEvents(hostRef, pressConfig);\n\n  const element = React.Children.only(props.children);\n  const children = [element.props.children];\n  const supportedProps = pickProps(props);\n  supportedProps.accessibilityDisabled = disabled;\n  supportedProps.focusable = !disabled && focusable !== false;\n  supportedProps.ref = useMergeRefs(forwardedRef, hostRef, element.ref);\n\n  const elementProps = Object.assign(supportedProps, pressEventHandlers);\n\n  return React.cloneElement(element, elementProps, ...children);\n}\n\nconst MemoedTouchableWithoutFeedback = React.memo(\n  React.forwardRef(TouchableWithoutFeedback)\n);\nMemoedTouchableWithoutFeedback.displayName = 'TouchableWithoutFeedback';\n\nexport default (MemoedTouchableWithoutFeedback: React.AbstractComponent<\n  Props,\n  React.ElementRef<any>\n>);\n"
  },
  {
    "path": "packages/react-native-web/src/exports/UIManager/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport UIManager from '..';\n\nconst createStyledNode = (name = 'div', style = {}) => {\n  const root = document.createElement(name);\n  Object.keys(style).forEach((prop) => {\n    root.style[prop] = style[prop];\n  });\n  return root;\n};\n\nconst componentStub = {\n  _reactInternalInstance: {\n    _currentElement: { _owner: {} },\n    _debugID: 1\n  }\n};\n\ndescribe('apis/UIManager', () => {\n  describe('focus', () => {\n    test('sets tabIndex=\"-1\" on elements not programmatically focusable by default', () => {\n      const node = createStyledNode();\n      UIManager.focus(node);\n      expect(node.getAttribute('tabIndex')).toEqual('-1');\n    });\n\n    test('doesn\\'t set tabIndex=\"-1\" on elements with an existing tabIndex', () => {\n      const node = createStyledNode();\n      node.tabIndex = 0;\n      UIManager.focus(node);\n      expect(node.getAttribute('tabIndex')).toEqual('0');\n    });\n\n    test('doesn\\'t set tabIndex=\"-1\" on elements focusable by default', () => {\n      ['a', 'input', 'select', 'textarea'].forEach((name) => {\n        const node = createStyledNode(name);\n        UIManager.focus(node);\n        expect(node.getAttribute('tabIndex')).toBeNull();\n      });\n    });\n\n    test('doesn\\'t set tabIndex=\"-1\" in other cases', () => {\n      // on body\n      UIManager.focus(document.body);\n      expect(document.body.getAttribute('tabIndex')).toBeNull();\n\n      // on contenteditable elements\n      const div = document.createElement('div');\n      div.contentEditable = 'true';\n      div.isContentEditable = true; // jsdom doesn't support this API yet (https://github.com/jsdom/jsdom/issues/1670)\n      UIManager.focus(div);\n      expect(div.getAttribute('tabIndex')).toBeNull();\n    });\n  });\n\n  describe('updateView', () => {\n    test('supports className alias for class', () => {\n      const node = createStyledNode();\n      const props = { className: 'extra' };\n      UIManager.updateView(node, props, componentStub);\n      expect(node.getAttribute('class')).toEqual('extra');\n    });\n\n    test('adds correct DOM styles to existing style', () => {\n      const node = createStyledNode('div', { color: 'red' });\n      const props = { style: { marginTop: 0, marginBottom: 0, opacity: 0 } };\n      UIManager.updateView(node, props, componentStub);\n      expect(node.getAttribute('style')).toEqual(\n        'color: red; margin-top: 0px; margin-bottom: 0px; opacity: 0;'\n      );\n    });\n\n    test('replaces input and textarea text', () => {\n      const node = createStyledNode('textarea');\n      node.value = 'initial';\n      const textProp = { text: 'expected-text' };\n      const valueProp = { value: 'expected-value' };\n\n      UIManager.updateView(node, textProp);\n      expect(node.value).toEqual('expected-text');\n\n      UIManager.updateView(node, valueProp);\n      expect(node.value).toEqual('expected-value');\n    });\n\n    test('sets other attribute values', () => {\n      const node = createStyledNode();\n      const props = { 'aria-level': '4', 'data-of-type': 'string' };\n      UIManager.updateView(node, props);\n      expect(node.getAttribute('aria-level')).toEqual('4');\n      expect(node.getAttribute('data-of-type')).toEqual('string');\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/UIManager/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @noflow\n */\n\nimport getBoundingClientRect from '../../modules/getBoundingClientRect';\nimport setValueForStyles from '../../modules/setValueForStyles';\n\nconst getRect = (node) => {\n  const height = node.offsetHeight;\n  const width = node.offsetWidth;\n  let left = node.offsetLeft;\n  let top = node.offsetTop;\n  node = node.offsetParent;\n\n  while (node && node.nodeType === 1 /* Node.ELEMENT_NODE */) {\n    left += node.offsetLeft + node.clientLeft - node.scrollLeft;\n    top += node.offsetTop + node.clientTop - node.scrollTop;\n    node = node.offsetParent;\n  }\n\n  top -= window.scrollY;\n  left -= window.scrollX;\n\n  return { width, height, top, left };\n};\n\nconst measureLayout = (node, relativeToNativeNode, callback) => {\n  const relativeNode = relativeToNativeNode || (node && node.parentNode);\n  if (node && relativeNode) {\n    setTimeout(() => {\n      if (node.isConnected && relativeNode.isConnected) {\n        const relativeRect = getRect(relativeNode);\n        const { height, left, top, width } = getRect(node);\n        const x = left - relativeRect.left;\n        const y = top - relativeRect.top;\n        callback(x, y, width, height, left, top);\n      }\n    }, 0);\n  }\n};\n\nconst elementsToIgnore = {\n  A: true,\n  BODY: true,\n  INPUT: true,\n  SELECT: true,\n  TEXTAREA: true\n};\n\nconst UIManager = {\n  blur(node) {\n    try {\n      node.blur();\n    } catch (err) {}\n  },\n\n  focus(node) {\n    try {\n      const name = node.nodeName;\n      // A tabIndex of -1 allows element to be programmatically focused but\n      // prevents keyboard focus. We don't want to set the tabindex value on\n      // elements that should not prevent keyboard focus.\n      if (\n        node.getAttribute('tabIndex') == null &&\n        node.isContentEditable !== true &&\n        elementsToIgnore[name] == null\n      ) {\n        node.setAttribute('tabIndex', '-1');\n      }\n      node.focus();\n    } catch (err) {}\n  },\n\n  measure(node, callback) {\n    measureLayout(node, null, callback);\n  },\n\n  measureInWindow(node, callback) {\n    if (node) {\n      setTimeout(() => {\n        const { height, left, top, width } = getBoundingClientRect(node);\n        callback(left, top, width, height);\n      }, 0);\n    }\n  },\n\n  measureLayout(node, relativeToNativeNode, onFail, onSuccess) {\n    measureLayout(node, relativeToNativeNode, onSuccess);\n  },\n\n  updateView(node, props) {\n    for (const prop in props) {\n      if (!Object.prototype.hasOwnProperty.call(props, prop)) {\n        continue;\n      }\n\n      const value = props[prop];\n      switch (prop) {\n        case 'style': {\n          setValueForStyles(node, value);\n          break;\n        }\n        case 'class':\n        case 'className': {\n          node.setAttribute('class', value);\n          break;\n        }\n        case 'text':\n        case 'value':\n          // native platforms use `text` prop to replace text input value\n          node.value = value;\n          break;\n        default:\n          node.setAttribute(prop, value);\n      }\n    }\n  },\n\n  configureNextLayoutAnimation(config, onAnimationDidEnd) {\n    onAnimationDidEnd();\n  },\n\n  // mocks\n  setLayoutAnimationEnabledExperimental() {}\n};\n\nexport default UIManager;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/Vibration/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\ntype VibratePattern = number | Array<number>;\n\nconst vibrate = (pattern: VibratePattern) => {\n  if ('vibrate' in window.navigator) {\n    window.navigator.vibrate(pattern);\n  }\n};\n\nconst Vibration = {\n  cancel() {\n    vibrate(0);\n  },\n  vibrate(pattern: VibratePattern = 400) {\n    vibrate(pattern);\n  }\n};\n\nexport default Vibration;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/View/__tests__/__snapshots__/index-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`components/View default 1`] = `\n<div\n  class=\"css-view-g5y9jx\"\n/>\n`;\n\nexports[`components/View non-text is rendered 1`] = `\n<div\n  class=\"css-view-g5y9jx\"\n>\n  <div\n    class=\"css-view-g5y9jx\"\n    data-testid=\"1\"\n  />\n</div>\n`;\n\nexports[`components/View prop \"aria-label\" value is set 1`] = `\n<div\n  aria-label=\"accessibility label\"\n  class=\"css-view-g5y9jx\"\n/>\n`;\n\nexports[`components/View prop \"aria-labelledby\" value is set 1`] = `\n<div\n  aria-labelledby=\"123\"\n  class=\"css-view-g5y9jx\"\n/>\n`;\n\nexports[`components/View prop \"aria-live\" value is set 1`] = `\n<div\n  aria-live=\"polite\"\n  class=\"css-view-g5y9jx\"\n/>\n`;\n\nexports[`components/View prop \"dir\" value is \"ltr\" 1`] = `\n<div\n  class=\"css-view-g5y9jx\"\n  dir=\"ltr\"\n/>\n`;\n\nexports[`components/View prop \"dir\" value is \"rtl\" 1`] = `\n<div\n  class=\"css-view-g5y9jx\"\n  dir=\"rtl\"\n/>\n`;\n\nexports[`components/View prop \"href\" href with accessibilityRole 1`] = `\n<a\n  class=\"css-view-g5y9jx\"\n  href=\"https://example.com\"\n  role=\"presentation\"\n/>\n`;\n\nexports[`components/View prop \"href\" value is set 1`] = `\n<a\n  class=\"css-view-g5y9jx\"\n  href=\"https://example.com\"\n/>\n`;\n\nexports[`components/View prop \"hrefAttrs\" null values are excluded 1`] = `\n<a\n  class=\"css-view-g5y9jx\"\n  href=\"https://example.com\"\n/>\n`;\n\nexports[`components/View prop \"hrefAttrs\" requires \"href\" 1`] = `\n<div\n  class=\"css-view-g5y9jx\"\n/>\n`;\n\nexports[`components/View prop \"hrefAttrs\" target variant is set 1`] = `\n<a\n  class=\"css-view-g5y9jx\"\n  href=\"https://example.com\"\n  target=\"_blank\"\n/>\n`;\n\nexports[`components/View prop \"hrefAttrs\" value is set 1`] = `\n<a\n  class=\"css-view-g5y9jx\"\n  download=\"filename.jpg\"\n  href=\"https://example.com\"\n  rel=\"nofollow\"\n  target=\"_blank\"\n/>\n`;\n\nexports[`components/View prop \"lang\" ar 1`] = `\n<div\n  class=\"css-view-g5y9jx\"\n  dir=\"rtl\"\n  lang=\"ar\"\n/>\n`;\n\nexports[`components/View prop \"lang\" fr 1`] = `\n<div\n  class=\"css-view-g5y9jx\"\n  dir=\"ltr\"\n  lang=\"fr\"\n/>\n`;\n\nexports[`components/View prop \"lang\" undefined 1`] = `\n<div\n  class=\"css-view-g5y9jx\"\n/>\n`;\n\nexports[`components/View prop \"lang\" with dir 1`] = `\n<div\n  class=\"css-view-g5y9jx\"\n  dir=\"ltr\"\n  lang=\"ar\"\n/>\n`;\n\nexports[`components/View prop \"nativeID\" value is set 1`] = `\n<div\n  class=\"css-view-g5y9jx\"\n  id=\"nativeID\"\n/>\n`;\n\nexports[`components/View prop \"pointerEvents\" 1`] = `\n<div\n  class=\"css-view-g5y9jx r-pointerEvents-ah5dr5\"\n/>\n`;\n\nexports[`components/View prop \"role\" value alters HTML element 1`] = `\n<article\n  class=\"css-view-g5y9jx\"\n  role=\"article\"\n/>\n`;\n\nexports[`components/View prop \"role\" value is \"button\" 1`] = `\n<button\n  class=\"css-view-g5y9jx\"\n  role=\"button\"\n  type=\"button\"\n/>\n`;\n\nexports[`components/View prop \"role\" value is set 1`] = `\n<div\n  class=\"css-view-g5y9jx\"\n  role=\"presentation\"\n/>\n`;\n\nexports[`components/View prop \"style\" value is set 1`] = `\n<div\n  class=\"css-view-g5y9jx\"\n  style=\"border-top-width: 5px; border-right-width: 5px; border-bottom-width: 5px; border-left-width: 5px;\"\n/>\n`;\n\nexports[`components/View prop \"testID\" value is set 1`] = `\n<div\n  class=\"css-view-g5y9jx\"\n  data-testid=\"123\"\n/>\n`;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/View/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport React from 'react';\nimport View from '../';\nimport { createEventTarget, setPointerEvent } from 'dom-event-testing-library';\nimport { act, render } from '@testing-library/react';\n\ndescribe('components/View', () => {\n  test('default', () => {\n    const { container } = render(<View />);\n    expect(container.firstChild).toMatchSnapshot();\n  });\n\n  test('non-text is rendered', () => {\n    const children = <View testID=\"1\" />;\n    const { container } = render(<View>{children}</View>);\n    expect(container.firstChild).toMatchSnapshot();\n  });\n\n  describe('raw text nodes as children', () => {\n    beforeEach(() => {\n      jest.spyOn(console, 'error');\n      console.error.mockImplementation(() => {});\n    });\n\n    afterEach(() => {\n      console.error.mockRestore();\n    });\n\n    test('error logged (single)', () => {\n      render(<View>hello</View>);\n      expect(console.error).toBeCalled();\n    });\n\n    test('error logged (array)', () => {\n      render(\n        <View>\n          <View />\n          hello\n          <View />\n        </View>\n      );\n      expect(console.error).toBeCalled();\n    });\n  });\n\n  describe('prop \"aria-label\"', () => {\n    test('value is set', () => {\n      const { container } = render(<View aria-label=\"accessibility label\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"aria-labelledby\"', () => {\n    test('value is set', () => {\n      const { container } = render(<View aria-labelledby=\"123\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"aria-live\"', () => {\n    test('value is set', () => {\n      const { container } = render(<View aria-live=\"polite\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"role\"', () => {\n    test('value is set', () => {\n      const { container } = render(<View role=\"none\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('value is \"button\"', () => {\n      const { container } = render(<View role=\"button\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('value alters HTML element', () => {\n      const { container } = render(<View role=\"article\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"dir\"', () => {\n    test('value is \"ltr\"', () => {\n      const { container } = render(<View dir=\"ltr\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('value is \"rtl\"', () => {\n      const { container } = render(<View dir=\"rtl\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"href\"', () => {\n    test('value is set', () => {\n      const { container } = render(<View href=\"https://example.com\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('href with accessibilityRole', () => {\n      const { container } = render(\n        <View accessibilityRole=\"none\" href=\"https://example.com\" />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"hrefAttrs\"', () => {\n    test('requires \"href\"', () => {\n      const { container } = render(\n        <View hrefAttrs={{ download: 'filename.jpg' }} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('value is set', () => {\n      const hrefAttrs = {\n        download: 'filename.jpg',\n        rel: 'nofollow',\n        target: '_blank'\n      };\n      const { container } = render(\n        <View href=\"https://example.com\" hrefAttrs={hrefAttrs} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('target variant is set', () => {\n      const hrefAttrs = {\n        target: 'blank'\n      };\n      const { container } = render(\n        <View href=\"https://example.com\" hrefAttrs={hrefAttrs} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('null values are excluded', () => {\n      const hrefAttrs = {\n        download: null,\n        rel: null,\n        target: null\n      };\n      const { container } = render(\n        <View href=\"https://example.com\" hrefAttrs={hrefAttrs} />\n      );\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"lang\"', () => {\n    test('undefined', () => {\n      const { container } = render(<View />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('fr', () => {\n      const { container } = render(<View lang=\"fr\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('ar', () => {\n      const { container } = render(<View lang=\"ar\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n\n    test('with dir', () => {\n      const { container } = render(<View dir=\"ltr\" lang=\"ar\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"nativeID\"', () => {\n    test('value is set', () => {\n      const { container } = render(<View nativeID=\"nativeID\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"onBlur\"', () => {\n    test('is called', () => {\n      const onBlur = jest.fn();\n      const ref = React.createRef();\n      act(() => {\n        render(<View onBlur={onBlur} ref={ref} />);\n      });\n      const target = createEventTarget(ref.current);\n      const body = createEventTarget(document.body);\n      act(() => {\n        target.focus();\n        body.focus({ relatedTarget: target.node });\n      });\n      expect(onBlur).toBeCalled();\n    });\n  });\n\n  describe('prop \"onClick\"', () => {\n    test('is called', () => {\n      const onClick = jest.fn();\n      const ref = React.createRef();\n      act(() => {\n        render(<View onClick={onClick} ref={ref} />);\n      });\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.click();\n      });\n      expect(onClick).toBeCalled();\n    });\n  });\n\n  describe('prop \"onFocus\"', () => {\n    test('is called', () => {\n      const onFocus = jest.fn();\n      const ref = React.createRef();\n      act(() => {\n        render(<View onFocus={onFocus} ref={ref} />);\n      });\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.focus();\n        target.blur();\n      });\n      expect(onFocus).toBeCalled();\n    });\n  });\n\n  describe('prop \"onPointerDown\"', () => {\n    beforeEach(() => {\n      setPointerEvent(true);\n    });\n    afterEach(() => {\n      setPointerEvent(false);\n    });\n\n    test('is called', () => {\n      const onPointerDown = jest.fn();\n      const ref = React.createRef();\n      act(() => {\n        render(<View onPointerDown={onPointerDown} ref={ref} />);\n      });\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.pointerdown({ pointerType: 'touch' });\n      });\n      expect(onPointerDown).toBeCalled();\n    });\n  });\n\n  describe('prop \"ref\"', () => {\n    test('value is set', () => {\n      const ref = jest.fn();\n      render(<View ref={ref} />);\n      expect(ref).toBeCalled();\n    });\n\n    test('is not called for prop changes', () => {\n      const ref = jest.fn();\n      let rerender;\n      act(() => {\n        ({ rerender } = render(\n          <View nativeID=\"123\" ref={ref} style={{ borderWidth: 5 }} />\n        ));\n      });\n      expect(ref).toHaveBeenCalledTimes(1);\n      act(() => {\n        rerender(<View nativeID=\"1234\" ref={ref} style={{ borderWidth: 6 }} />);\n      });\n      expect(ref).toHaveBeenCalledTimes(1);\n    });\n\n    test('node has imperative methods', () => {\n      const ref = React.createRef();\n      act(() => {\n        render(<View ref={ref} />);\n      });\n      const node = ref.current;\n      expect(typeof node.measure === 'function');\n      expect(typeof node.measureLayout === 'function');\n      expect(typeof node.measureInWindow === 'function');\n    });\n  });\n\n  test('prop \"pointerEvents\"', () => {\n    const { container } = render(<View pointerEvents=\"box-only\" />);\n    expect(container.firstChild).toMatchSnapshot();\n  });\n\n  describe('prop \"style\"', () => {\n    test('value is set', () => {\n      const { container } = render(<View style={{ borderWidth: 5 }} />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n\n  describe('prop \"testID\"', () => {\n    test('value is set', () => {\n      const { container } = render(<View testID=\"123\" />);\n      expect(container.firstChild).toMatchSnapshot();\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/View/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use client';\n\nimport type { PlatformMethods } from '../../types';\nimport type { ViewProps } from './types';\n\nimport * as React from 'react';\nimport createElement from '../createElement';\nimport * as forwardedProps from '../../modules/forwardedProps';\nimport pick from '../../modules/pick';\nimport useElementLayout from '../../modules/useElementLayout';\nimport useMergeRefs from '../../modules/useMergeRefs';\nimport usePlatformMethods from '../../modules/usePlatformMethods';\nimport useResponderEvents from '../../modules/useResponderEvents';\nimport StyleSheet from '../StyleSheet';\nimport TextAncestorContext from '../Text/TextAncestorContext';\nimport { useLocaleContext, getLocaleDirection } from '../../modules/useLocale';\n\nconst forwardPropsList = Object.assign(\n  {},\n  forwardedProps.defaultProps,\n  forwardedProps.accessibilityProps,\n  forwardedProps.clickProps,\n  forwardedProps.focusProps,\n  forwardedProps.keyboardProps,\n  forwardedProps.mouseProps,\n  forwardedProps.touchProps,\n  forwardedProps.styleProps,\n  {\n    href: true,\n    lang: true,\n    onScroll: true,\n    onWheel: true,\n    pointerEvents: true\n  }\n);\n\nconst pickProps = (props) => pick(props, forwardPropsList);\n\nconst View: React.AbstractComponent<ViewProps, HTMLElement & PlatformMethods> =\n  React.forwardRef((props, forwardedRef) => {\n    const {\n      hrefAttrs,\n      onLayout,\n      onMoveShouldSetResponder,\n      onMoveShouldSetResponderCapture,\n      onResponderEnd,\n      onResponderGrant,\n      onResponderMove,\n      onResponderReject,\n      onResponderRelease,\n      onResponderStart,\n      onResponderTerminate,\n      onResponderTerminationRequest,\n      onScrollShouldSetResponder,\n      onScrollShouldSetResponderCapture,\n      onSelectionChangeShouldSetResponder,\n      onSelectionChangeShouldSetResponderCapture,\n      onStartShouldSetResponder,\n      onStartShouldSetResponderCapture,\n      ...rest\n    } = props;\n\n    if (process.env.NODE_ENV !== 'production') {\n      React.Children.toArray(props.children).forEach((item) => {\n        if (typeof item === 'string') {\n          console.error(\n            `Unexpected text node: ${item}. A text node cannot be a child of a <View>.`\n          );\n        }\n      });\n    }\n\n    const hasTextAncestor = React.useContext(TextAncestorContext);\n    const hostRef = React.useRef(null);\n    const { direction: contextDirection } = useLocaleContext();\n\n    useElementLayout(hostRef, onLayout);\n    useResponderEvents(hostRef, {\n      onMoveShouldSetResponder,\n      onMoveShouldSetResponderCapture,\n      onResponderEnd,\n      onResponderGrant,\n      onResponderMove,\n      onResponderReject,\n      onResponderRelease,\n      onResponderStart,\n      onResponderTerminate,\n      onResponderTerminationRequest,\n      onScrollShouldSetResponder,\n      onScrollShouldSetResponderCapture,\n      onSelectionChangeShouldSetResponder,\n      onSelectionChangeShouldSetResponderCapture,\n      onStartShouldSetResponder,\n      onStartShouldSetResponderCapture\n    });\n\n    let component = 'div';\n\n    const langDirection =\n      props.lang != null ? getLocaleDirection(props.lang) : null;\n    const componentDirection = props.dir || langDirection;\n    const writingDirection = componentDirection || contextDirection;\n\n    const supportedProps = pickProps(rest);\n    supportedProps.dir = componentDirection;\n    supportedProps.style = [\n      styles.view$raw,\n      hasTextAncestor && styles.inline,\n      props.style\n    ];\n    if (props.href != null) {\n      component = 'a';\n      if (hrefAttrs != null) {\n        const { download, rel, target } = hrefAttrs;\n        if (download != null) {\n          supportedProps.download = download;\n        }\n        if (rel != null) {\n          supportedProps.rel = rel;\n        }\n        if (typeof target === 'string') {\n          supportedProps.target =\n            target.charAt(0) !== '_' ? '_' + target : target;\n        }\n      }\n    }\n\n    const platformMethodsRef = usePlatformMethods(supportedProps);\n    const setRef = useMergeRefs(hostRef, platformMethodsRef, forwardedRef);\n\n    supportedProps.ref = setRef;\n\n    return createElement(component, supportedProps, { writingDirection });\n  });\n\nView.displayName = 'View';\n\nconst styles = StyleSheet.create({\n  view$raw: {\n    alignContent: 'flex-start',\n    alignItems: 'stretch',\n    backgroundColor: 'transparent',\n    border: '0 solid black',\n    boxSizing: 'border-box',\n    display: 'flex',\n    flexBasis: 'auto',\n    flexDirection: 'column',\n    flexShrink: 0,\n    listStyle: 'none',\n    margin: 0,\n    minHeight: 0,\n    minWidth: 0,\n    padding: 0,\n    position: 'relative',\n    textDecoration: 'none',\n    zIndex: 0\n  },\n  inline: {\n    display: 'inline-flex'\n  }\n});\n\nexport type { ViewProps };\n\nexport default View;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/View/types.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport type { ColorValue, GenericStyleProp, LayoutEvent } from '../../types';\n\nimport type {\n  AnimationStyles,\n  BorderStyles,\n  InteractionStyles,\n  LayoutStyles,\n  ShadowStyles,\n  TransformStyles\n} from '../../types/styles';\n\ntype NumberOrString = number | string;\ntype OverscrollBehaviorValue = 'auto' | 'contain' | 'none';\ntype idRef = string;\ntype idRefList = idRef | Array<idRef>;\n\nexport type AccessibilityProps = {|\n  'aria-activedescendant'?: ?idRef,\n  'aria-atomic'?: ?boolean,\n  'aria-autocomplete'?: ?('none' | 'list' | 'inline' | 'both'),\n  'aria-busy'?: ?boolean,\n  'aria-checked'?: ?(boolean | 'mixed'),\n  'aria-colcount'?: ?number,\n  'aria-colindex'?: ?number,\n  'aria-colspan'?: ?number,\n  'aria-controls'?: ?idRef,\n  'aria-current'?: ?(boolean | 'page' | 'step' | 'location' | 'date' | 'time'),\n  'aria-describedby'?: ?idRef,\n  'aria-details'?: ?idRef,\n  'aria-disabled'?: ?boolean,\n  'aria-errormessage'?: ?idRef,\n  'aria-expanded'?: ?boolean,\n  'aria-flowto'?: ?idRef,\n  'aria-haspopup'?: ?('dialog' | 'grid' | 'listbox' | 'menu' | 'tree' | false),\n  'aria-hidden'?: ?boolean,\n  'aria-invalid'?: ?boolean,\n  'aria-keyshortcuts'?: ?Array<string>,\n  'aria-label'?: ?string,\n  'aria-labelledby'?: ?idRef,\n  'aria-level'?: ?number,\n  'aria-live'?: ?('assertive' | 'none' | 'polite'),\n  'aria-modal'?: ?boolean,\n  'aria-multiline'?: ?boolean,\n  'aria-multiselectable'?: ?boolean,\n  'aria-orientation'?: ?('horizontal' | 'vertical'),\n  'aria-owns'?: ?idRef,\n  'aria-placeholder'?: ?string,\n  'aria-posinset'?: ?number,\n  'aria-pressed'?: ?(boolean | 'mixed'),\n  'aria-readonly'?: ?boolean,\n  'aria-required'?: ?boolean,\n  'aria-roledescription'?: ?string,\n  'aria-rowcount'?: ?number,\n  'aria-rowindex'?: ?number,\n  'aria-rowspan'?: ?number,\n  'aria-selected'?: ?boolean,\n  'aria-setsize'?: ?number,\n  'aria-sort'?: ?('ascending' | 'descending' | 'none' | 'other'),\n  'aria-valuemax'?: ?number,\n  'aria-valuemin'?: ?number,\n  'aria-valuenow'?: ?number,\n  'aria-valuetext'?: ?string,\n  role?: ?string,\n\n  // @deprecated\n  accessibilityActiveDescendant?: ?idRef,\n  accessibilityAtomic?: ?boolean,\n  accessibilityAutoComplete?: ?('none' | 'list' | 'inline' | 'both'),\n  accessibilityBusy?: ?boolean,\n  accessibilityChecked?: ?(boolean | 'mixed'),\n  accessibilityColumnCount?: ?number,\n  accessibilityColumnIndex?: ?number,\n  accessibilityColumnSpan?: ?number,\n  accessibilityControls?: ?idRefList,\n  accessibilityCurrent?: ?(\n    | boolean\n    | 'page'\n    | 'step'\n    | 'location'\n    | 'date'\n    | 'time'\n  ),\n  accessibilityDescribedBy?: ?idRefList,\n  accessibilityDetails?: ?idRef,\n  accessibilityDisabled?: ?boolean,\n  accessibilityErrorMessage?: ?idRef,\n  accessibilityExpanded?: ?boolean,\n  accessibilityFlowTo?: ?idRefList,\n  accessibilityHasPopup?: ?(\n    | 'dialog'\n    | 'grid'\n    | 'listbox'\n    | 'menu'\n    | 'tree'\n    | false\n  ),\n  accessibilityHidden?: ?boolean,\n  accessibilityInvalid?: ?boolean,\n  accessibilityKeyShortcuts?: ?Array<string>,\n  accessibilityLabel?: ?string,\n  accessibilityLabelledBy?: ?idRefList,\n  accessibilityLevel?: ?number,\n  accessibilityLiveRegion?: ?('assertive' | 'none' | 'polite'),\n  accessibilityModal?: ?boolean,\n  accessibilityMultiline?: ?boolean,\n  accessibilityMultiSelectable?: ?boolean,\n  accessibilityOrientation?: ?('horizontal' | 'vertical'),\n  accessibilityOwns?: ?idRefList,\n  accessibilityPlaceholder?: ?string,\n  accessibilityPosInSet?: ?number,\n  accessibilityPressed?: ?(boolean | 'mixed'),\n  accessibilityReadOnly?: ?boolean,\n  accessibilityRequired?: ?boolean,\n  accessibilityRole?: ?string,\n  accessibilityRoleDescription?: ?string,\n  accessibilityRowCount?: ?number,\n  accessibilityRowIndex?: ?number,\n  accessibilityRowSpan?: ?number,\n  accessibilitySelected?: ?boolean,\n  accessibilitySetSize?: ?number,\n  accessibilitySort?: ?('ascending' | 'descending' | 'none' | 'other'),\n  accessibilityValueMax?: ?number,\n  accessibilityValueMin?: ?number,\n  accessibilityValueNow?: ?number,\n  accessibilityValueText?: ?string\n|};\n\nexport type EventProps = {|\n  onAuxClick?: (e: any) => void,\n  onBlur?: (e: any) => void,\n  onClick?: (e: any) => void,\n  onContextMenu?: (e: any) => void,\n  onFocus?: (e: any) => void,\n  onGotPointerCapture?: (e: any) => void,\n  onKeyDown?: (e: any) => void,\n  onKeyUp?: (e: any) => void,\n  onLayout?: (e: LayoutEvent) => void,\n  onLostPointerCapture?: (e: any) => void,\n  onMoveShouldSetResponder?: (e: any) => boolean,\n  onMoveShouldSetResponderCapture?: (e: any) => boolean,\n  onPointerCancel?: (e: any) => void,\n  onPointerDown?: (e: any) => void,\n  onPointerEnter?: (e: any) => void,\n  onPointerMove?: (e: any) => void,\n  onPointerLeave?: (e: any) => void,\n  onPointerOut?: (e: any) => void,\n  onPointerOver?: (e: any) => void,\n  onPointerUp?: (e: any) => void,\n  onResponderEnd?: (e: any) => void,\n  onResponderGrant?: (e: any) => void | boolean,\n  onResponderMove?: (e: any) => void,\n  onResponderReject?: (e: any) => void,\n  onResponderRelease?: (e: any) => void,\n  onResponderStart?: (e: any) => void,\n  onResponderTerminate?: (e: any) => void,\n  onResponderTerminationRequest?: (e: any) => boolean,\n  onScrollShouldSetResponder?: (e: any) => boolean,\n  onScrollShouldSetResponderCapture?: (e: any) => boolean,\n  onSelectionChangeShouldSetResponder?: (e: any) => boolean,\n  onSelectionChangeShouldSetResponderCapture?: (e: any) => boolean,\n  onStartShouldSetResponder?: (e: any) => boolean,\n  onStartShouldSetResponderCapture?: (e: any) => boolean,\n  // unstable\n  onMouseDown?: (e: any) => void,\n  onMouseEnter?: (e: any) => void,\n  onMouseLeave?: (e: any) => void,\n  onMouseMove?: (e: any) => void,\n  onMouseOver?: (e: any) => void,\n  onMouseOut?: (e: any) => void,\n  onMouseUp?: (e: any) => void,\n  onScroll?: (e: any) => void,\n  onTouchCancel?: (e: any) => void,\n  onTouchCancelCapture?: (e: any) => void,\n  onTouchEnd?: (e: any) => void,\n  onTouchEndCapture?: (e: any) => void,\n  onTouchMove?: (e: any) => void,\n  onTouchMoveCapture?: (e: any) => void,\n  onTouchStart?: (e: any) => void,\n  onTouchStartCapture?: (e: any) => void,\n  onWheel?: (e: any) => void\n|};\n\nexport type ViewStyle = {\n  ...AnimationStyles,\n  ...BorderStyles,\n  ...InteractionStyles,\n  ...LayoutStyles,\n  ...ShadowStyles,\n  ...TransformStyles,\n  backdropFilter?: ?string,\n  backgroundAttachment?: ?string,\n  backgroundBlendMode?: ?string,\n  backgroundClip?: ?string,\n  backgroundColor?: ?ColorValue,\n  backgroundImage?: ?string,\n  backgroundOrigin?: 'border-box' | 'content-box' | 'padding-box',\n  backgroundPosition?: ?string,\n  backgroundRepeat?: ?string,\n  backgroundSize?: ?string,\n  boxShadow?: ?string,\n  clip?: ?string,\n  filter?: ?string,\n  opacity?: ?number,\n  outlineColor?: ?ColorValue,\n  outlineOffset?: ?NumberOrString,\n  outlineStyle?: ?string,\n  outlineWidth?: ?NumberOrString,\n  overscrollBehavior?: ?OverscrollBehaviorValue,\n  overscrollBehaviorX?: ?OverscrollBehaviorValue,\n  overscrollBehaviorY?: ?OverscrollBehaviorValue,\n  pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto',\n  scrollbarWidth?: 'auto' | 'none' | 'thin',\n  scrollSnapAlign?: ?string,\n  scrollSnapType?: ?string,\n  WebkitMaskImage?: ?string,\n  WebkitOverflowScrolling?: 'auto' | 'touch'\n};\n\nexport type ViewProps = {\n  ...AccessibilityProps,\n  ...EventProps,\n  children?: ?any,\n  dataSet?: { ... },\n  dir?: 'ltr' | 'rtl',\n  id?: ?string,\n  lang?: string,\n  style?: GenericStyleProp<ViewStyle>,\n  tabIndex?: ?(0 | -1),\n  testID?: ?string,\n  // unstable\n  href?: ?string,\n  hrefAttrs?: ?{ download?: ?boolean, rel?: ?string, target?: ?string },\n  // @deprecated\n  focusable?: ?boolean,\n  pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto',\n  nativeID?: ?string\n};\n"
  },
  {
    "path": "packages/react-native-web/src/exports/VirtualizedList/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use client';\n\nimport VirtualizedList from '../../vendor/react-native/VirtualizedList';\nexport default VirtualizedList;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/YellowBox/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport type { Node } from 'React';\n\nimport React from 'react';\nimport UnimplementedView from '../../modules/UnimplementedView';\n\nfunction YellowBox(props: Object): Node {\n  return <UnimplementedView {...props} />;\n}\n\nYellowBox.ignoreWarnings = () => {};\n\nexport default YellowBox;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/createElement/__tests__/__snapshots__/index-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`exports/createElement renders different DOM elements 1`] = `<span />`;\n\nexports[`exports/createElement renders different DOM elements 2`] = `<main />`;\n\nexports[`exports/createElement renders different DOM elements 3`] = `\n<svg>\n  <image\n    href=\"#href\"\n  />\n</svg>\n`;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/createElement/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport createElement from '..';\nimport React from 'react';\nimport { render } from '@testing-library/react';\n\nfunction getAttribute(container, attribute) {\n  return container.firstChild.getAttribute(attribute);\n}\n\nfunction getProperty(container, prop) {\n  return container.firstChild[prop];\n}\n\ndescribe('exports/createElement', () => {\n  test('renders different DOM elements', () => {\n    let { container } = render(createElement('span'));\n    expect(container.firstChild).toMatchSnapshot();\n    ({ container } = render(createElement('main')));\n    expect(container.firstChild).toMatchSnapshot();\n    ({ container } = render(\n      createElement('svg', {\n        children: createElement('image', { href: '#href' })\n      })\n    ));\n    expect(container.firstChild).toMatchSnapshot();\n  });\n\n  describe('prop \"accessibilityRole\"', () => {\n    test('string component type', () => {\n      const { container } = render(\n        createElement('span', { accessibilityRole: 'link' })\n      );\n      expect(container.firstChild.nodeName).toBe('SPAN');\n    });\n\n    test('function component type', () => {\n      const Custom = () => <div />;\n      const { container } = render(\n        createElement(Custom, { accessibilityRole: 'link' })\n      );\n      expect(container.firstChild.nodeName).toBe('DIV');\n    });\n  });\n\n  describe('accessibility props', () => {\n    test('accessibilityActiveDescendant', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityActiveDescendant: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-activedescendant')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityActiveDescendant: 'abc' })\n      );\n      expect(getAttribute(hasValue, 'aria-activedescendant')).toBe('abc');\n    });\n\n    test('accessibilityAtomic', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityAtomic: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-atomic')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityAtomic: true })\n      );\n      expect(getAttribute(hasValue, 'aria-atomic')).toBe('true');\n    });\n\n    test('accessibilityAutoComplete', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityAutoComplete: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-autocomplete')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityAutoComplete: true })\n      );\n      expect(getAttribute(hasValue, 'aria-autocomplete')).toBe('true');\n    });\n\n    test('accessibilityBusy', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityBusy: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-busy')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityBusy: true })\n      );\n      expect(getAttribute(hasValue, 'aria-busy')).toBe('true');\n    });\n\n    test('accessibilityChecked', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityChecked: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-checked')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityChecked: true })\n      );\n      expect(getAttribute(hasValue, 'aria-checked')).toBe('true');\n    });\n\n    test('accessibilityColumnCount', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityColumnCount: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-colcount')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityColumnCount: 5 })\n      );\n      expect(getAttribute(hasValue, 'aria-colcount')).toBe('5');\n    });\n\n    test('accessibilityColumnIndex', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityColumnIndex: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-colindex')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityColumnIndex: 5 })\n      );\n      expect(getAttribute(hasValue, 'aria-colindex')).toBe('5');\n    });\n\n    test('accessibilityColumnSpan', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityColumnSpan: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-colspan')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityColumnSpan: 5 })\n      );\n      expect(getAttribute(hasValue, 'aria-colspan')).toBe('5');\n    });\n\n    test('accessibilityControls', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityControls: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-controls')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityControls: 'abc' })\n      );\n      expect(getAttribute(hasValue, 'aria-controls')).toBe('abc');\n      const { container: hasMultipleValues } = render(\n        createElement('div', { accessibilityControls: ['abc', 'def'] })\n      );\n      expect(getAttribute(hasMultipleValues, 'aria-controls')).toBe('abc def');\n    });\n\n    test('accessibilityCurrent', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityCurrent: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-current')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityCurrent: 'page' })\n      );\n      expect(getAttribute(hasValue, 'aria-current')).toBe('page');\n    });\n\n    test('accessibilityDescribedBy', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityDescribedBy: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-describedby')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityDescribedBy: 'abc' })\n      );\n      expect(getAttribute(hasValue, 'aria-describedby')).toBe('abc');\n      const { container: hasMultipleValues } = render(\n        createElement('div', { accessibilityDescribedBy: ['abc', 'def'] })\n      );\n      expect(getAttribute(hasMultipleValues, 'aria-describedby')).toBe(\n        'abc def'\n      );\n    });\n\n    test('accessibilityDetails', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityDetails: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-details')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityDetails: 'abc' })\n      );\n      expect(getAttribute(hasValue, 'aria-details')).toBe('abc');\n    });\n\n    test('accessibilityDisabled', () => {\n      const { container: isEmpty } = render(\n        createElement('button', { accessibilityDisabled: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-disabled')).toBeNull();\n      expect(getProperty(isEmpty, 'disabled')).toBe(false);\n      const { container: hasValue } = render(\n        createElement('button', { accessibilityDisabled: true })\n      );\n      expect(getAttribute(hasValue, 'aria-disabled')).toBe('true');\n      expect(getProperty(hasValue, 'disabled')).toBe(true);\n    });\n\n    test('accessibilityErrorMessage', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityErrorMessage: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-errormessage')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityErrorMessage: 'abc' })\n      );\n      expect(getAttribute(hasValue, 'aria-errormessage')).toBe('abc');\n    });\n\n    test('accessibilityExpanded', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityExpanded: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-expanded')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityExpanded: true })\n      );\n      expect(getAttribute(hasValue, 'aria-expanded')).toBe('true');\n    });\n\n    test('accessibilityFlowTo', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityFlowTo: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-flowto')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityFlowTo: 'abc' })\n      );\n      expect(getAttribute(hasValue, 'aria-flowto')).toBe('abc');\n      const { container: hasMultipleValues } = render(\n        createElement('div', { accessibilityFlowTo: ['abc', 'def'] })\n      );\n      expect(getAttribute(hasMultipleValues, 'aria-flowto')).toBe('abc def');\n    });\n\n    test('accessibilityHasPopup', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityHasPopup: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-haspopup')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityHasPopup: true })\n      );\n      expect(getAttribute(hasValue, 'aria-haspopup')).toBe('true');\n    });\n\n    test('accessibilityHidden', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityHidden: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-hidden')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityHidden: true })\n      );\n      expect(getAttribute(hasValue, 'aria-hidden')).toBe('true');\n    });\n\n    test('accessibilityInvalid', () => {\n      const { container: isEmpty } = render(\n        createElement('input', { accessibilityInvalid: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-invalid')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('input', { accessibilityInvalid: true })\n      );\n      expect(getAttribute(hasValue, 'aria-invalid')).toBe('true');\n    });\n\n    test('accessibilityKeyShortcuts', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityKeyShortcuts: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-keyshortcuts')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', {\n          accessibilityKeyShortcuts: [\n            'ArrowUp',\n            'Enter',\n            'Space',\n            'Alt+Shift+T'\n          ]\n        })\n      );\n      expect(getAttribute(hasValue, 'aria-keyshortcuts')).toBe(\n        'ArrowUp Enter Space Alt+Shift+T'\n      );\n    });\n\n    test('accessibilityLabel', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityLabel: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-label')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityLabel: 'abc' })\n      );\n      expect(getAttribute(hasValue, 'aria-label')).toBe('abc');\n    });\n\n    test('accessibilityLabelledBy', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityLabelledBy: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-labelledby')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityLabelledBy: 'abc' })\n      );\n      expect(getAttribute(hasValue, 'aria-labelledby')).toBe('abc');\n      const { container: hasMultipleValues } = render(\n        createElement('div', { accessibilityLabelledBy: ['abc', 'def'] })\n      );\n      expect(getAttribute(hasMultipleValues, 'aria-labelledby')).toBe(\n        'abc def'\n      );\n    });\n\n    test('accessibilityLevel', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityLevel: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-level')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityLevel: 3 })\n      );\n      expect(getAttribute(hasValue, 'aria-level')).toBe('3');\n    });\n\n    test('accessibilityLiveRegion', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityLiveRegion: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-live')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityLiveRegion: 'polite' })\n      );\n      expect(getAttribute(hasValue, 'aria-live')).toBe('polite');\n    });\n\n    test('accessibilityModal', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityModal: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-modal')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityModal: true })\n      );\n      expect(getAttribute(hasValue, 'aria-modal')).toBe('true');\n    });\n\n    test('accessibilityMultiline', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityMultiline: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-multiline')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityMultiline: true })\n      );\n      expect(getAttribute(hasValue, 'aria-multiline')).toBe('true');\n    });\n\n    test('accessibilityMultiSelectable', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityMultiSelectable: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-multiselectable')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityMultiSelectable: true })\n      );\n      expect(getAttribute(hasValue, 'aria-multiselectable')).toBe('true');\n    });\n\n    test('accessibilityOrientation', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityOrientation: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-orientation')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityOrientation: 'vertical' })\n      );\n      expect(getAttribute(hasValue, 'aria-orientation')).toBe('vertical');\n    });\n\n    test('accessibilityOwns', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityOwns: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-owns')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityOwns: 'abc' })\n      );\n      expect(getAttribute(hasValue, 'aria-owns')).toBe('abc');\n      const { container: hasMultipleValues } = render(\n        createElement('div', { accessibilityOwns: ['abc', 'def'] })\n      );\n      expect(getAttribute(hasMultipleValues, 'aria-owns')).toBe('abc def');\n    });\n\n    test('accessibilityPlaceholder', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityPlaceholder: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-placeholder')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityPlaceholder: 'MM-DD-YYYY' })\n      );\n      expect(getAttribute(hasValue, 'aria-placeholder')).toBe('MM-DD-YYYY');\n    });\n\n    test('accessibilityPosInSet', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityPosInSet: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-posinset')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityPosInSet: 3 })\n      );\n      expect(getAttribute(hasValue, 'aria-posinset')).toBe('3');\n    });\n\n    test('accessibilityPressed', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityPressed: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-pressed')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityPressed: true })\n      );\n      expect(getAttribute(hasValue, 'aria-pressed')).toBe('true');\n    });\n\n    test('accessibilityReadOnly', () => {\n      const { container: isEmpty } = render(\n        createElement('input', { accessibilityReadOnly: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-readonly')).toBeNull();\n      expect(getProperty(isEmpty, 'readOnly')).toBe(false);\n      const { container: hasValue } = render(\n        createElement('input', { accessibilityReadOnly: true })\n      );\n      expect(getAttribute(hasValue, 'aria-readonly')).toBe('true');\n      expect(getProperty(hasValue, 'readOnly')).toBe(true);\n    });\n\n    test('accessibilityRequired', () => {\n      const { container: isEmpty } = render(\n        createElement('input', { accessibilityRequired: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-required')).toBeNull();\n      expect(getProperty(isEmpty, 'required')).toBe(false);\n      const { container: hasValue } = render(\n        createElement('input', { accessibilityRequired: true })\n      );\n      expect(getAttribute(hasValue, 'aria-required')).toBe('true');\n      expect(getProperty(hasValue, 'required')).toBe(true);\n    });\n\n    test('accessibilityRole', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityRole: null })\n      );\n      expect(getAttribute(isEmpty, 'role')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityRole: 'button' })\n      );\n      expect(getAttribute(hasValue, 'role')).toBe('button');\n      const { container: roleIsNone } = render(\n        createElement('div', { accessibilityRole: 'none' })\n      );\n      expect(getAttribute(roleIsNone, 'role')).toBe('presentation');\n    });\n\n    test('accessibilityRoleDescription', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityRoleDescription: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-roledescription')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityRoleDescription: 'abc' })\n      );\n      expect(getAttribute(hasValue, 'aria-roledescription')).toBe('abc');\n    });\n\n    test('accessibilityRowCount', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityRowCount: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-rowcount')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityRowCount: 5 })\n      );\n      expect(getAttribute(hasValue, 'aria-rowcount')).toBe('5');\n    });\n\n    test('accessibilityRowIndex', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityRowIndex: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-rowindex')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityRowIndex: 5 })\n      );\n      expect(getAttribute(hasValue, 'aria-rowindex')).toBe('5');\n    });\n\n    test('accessibilityRowSpan', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityRowSpan: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-rowspan')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityRowSpan: 5 })\n      );\n      expect(getAttribute(hasValue, 'aria-rowspan')).toBe('5');\n    });\n\n    test('accessibilitySelected', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilitySelected: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-selected')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilitySelected: true })\n      );\n      expect(getAttribute(hasValue, 'aria-selected')).toBe('true');\n    });\n\n    test('accessibilitySetSize', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilitySetSize: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-setsize')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilitySetSize: 5 })\n      );\n      expect(getAttribute(hasValue, 'aria-setsize')).toBe('5');\n    });\n\n    test('accessibilitySort', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilitySort: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-sort')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilitySort: 'ascending' })\n      );\n      expect(getAttribute(hasValue, 'aria-sort')).toBe('ascending');\n    });\n\n    test('accessibilityValueMax', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityValueMax: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-valuemax')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityValueMax: 100 })\n      );\n      expect(getAttribute(hasValue, 'aria-valuemax')).toBe('100');\n    });\n\n    test('accessibilityValueMin', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityValueMin: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-valuemin')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityValueMin: 10 })\n      );\n      expect(getAttribute(hasValue, 'aria-valuemin')).toBe('10');\n    });\n\n    test('accessibilityValueNow', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityValueNow: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-valuenow')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityValueNow: 50 })\n      );\n      expect(getAttribute(hasValue, 'aria-valuenow')).toBe('50');\n    });\n\n    test('accessibilityValueText', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { accessibilityValueText: null })\n      );\n      expect(getAttribute(isEmpty, 'aria-valuetext')).toBeNull();\n      const { container: hasValue } = render(\n        createElement('div', { accessibilityValueText: 'fifty' })\n      );\n      expect(getAttribute(hasValue, 'aria-valuetext')).toBe('fifty');\n    });\n\n    test('dataSet', () => {\n      const { container: hasValue } = render(\n        createElement('div', {\n          dataSet: {\n            one: '1',\n            two: '2',\n            camelCase: 'camelCase',\n            msPrefix: 'msPrefix'\n          }\n        })\n      );\n      expect(hasValue.firstChild).toMatchInlineSnapshot(`\n        <div\n          data-camel-case=\"camelCase\"\n          data-ms-prefix=\"msPrefix\"\n          data-one=\"1\"\n          data-two=\"2\"\n        />\n      `);\n    });\n\n    test('focusable', () => {\n      const { container: isEmpty } = render(\n        createElement('div', { focusable: null })\n      );\n      expect(getAttribute(isEmpty, 'tabindex')).toBeNull();\n\n      const { container: isTrue } = render(\n        createElement('div', { focusable: true })\n      );\n      expect(getAttribute(isTrue, 'tabindex')).toBe('0');\n\n      const { container: isFalseNativelyFocusable } = render(\n        createElement('button', { focusable: false })\n      );\n      expect(getAttribute(isFalseNativelyFocusable, 'tabindex')).toBe('-1');\n\n      const { container: isDisabledNativelyFocusable } = render(\n        createElement('button', {\n          accessibilityDisabled: true,\n          focusable: true\n        })\n      );\n      expect(getAttribute(isDisabledNativelyFocusable, 'tabindex')).toBe('-1');\n\n      const { container: isTrueNativelyFocusable } = render(\n        createElement('button', { focusable: true })\n      );\n      expect(getAttribute(isTrueNativelyFocusable, 'tabindex')).toBeNull();\n\n      const { container: isFalseFocusableRole } = render(\n        createElement('div', { accessibilityRole: 'button', focusable: false })\n      );\n      expect(getAttribute(isFalseFocusableRole, 'tabindex')).toBe('-1');\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/createElement/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @noflow\n */\n\n'use client';\n\nimport AccessibilityUtil from '../../modules/AccessibilityUtil';\nimport createDOMProps from '../../modules/createDOMProps';\nimport React from 'react';\nimport { LocaleProvider } from '../../modules/useLocale';\n\nconst createElement = (component, props, options) => {\n  // Use equivalent platform elements where possible.\n  let accessibilityComponent;\n  if (component && component.constructor === String) {\n    accessibilityComponent =\n      AccessibilityUtil.propsToAccessibilityComponent(props);\n  }\n  const Component = accessibilityComponent || component;\n  const domProps = createDOMProps(Component, props, options);\n\n  const element = React.createElement(Component, domProps);\n\n  // Update locale context if element's writing direction prop changes\n  const elementWithLocaleProvider = domProps.dir ? (\n    <LocaleProvider\n      children={element}\n      direction={domProps.dir}\n      locale={domProps.lang}\n    />\n  ) : (\n    element\n  );\n\n  return elementWithLocaleProvider;\n};\n\nexport default createElement;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/findNodeHandle/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @noflow\n */\n\nconst findNodeHandle = (component) => {\n  throw new Error(\n    'findNodeHandle is not supported on web. ' +\n      'Use the ref property on the component instead.'\n  );\n};\n\nexport default findNodeHandle;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/processColor/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport processColor from '..';\n\nconst platformSpecific = (x) => x;\n\ndescribe('processColor', () => {\n  describe('predefined color names', () => {\n    it('should convert red', () => {\n      const colorFromString = processColor('red');\n      const expectedInt = 0xffff0000;\n      expect(colorFromString).toEqual(platformSpecific(expectedInt));\n    });\n\n    it('should convert white', () => {\n      const colorFromString = processColor('white');\n      const expectedInt = 0xffffffff;\n      expect(colorFromString).toEqual(platformSpecific(expectedInt));\n    });\n\n    it('should convert black', () => {\n      const colorFromString = processColor('black');\n      const expectedInt = 0xff000000;\n      expect(colorFromString).toEqual(platformSpecific(expectedInt));\n    });\n\n    it('should convert transparent', () => {\n      const colorFromString = processColor('transparent');\n      const expectedInt = 0x00000000;\n      expect(colorFromString).toEqual(platformSpecific(expectedInt));\n    });\n  });\n\n  describe('RGB strings', () => {\n    it('should convert rgb(x, y, z)', () => {\n      const colorFromString = processColor('rgb(10, 20, 30)');\n      const expectedInt = 0xff0a141e;\n      expect(colorFromString).toEqual(platformSpecific(expectedInt));\n    });\n  });\n\n  describe('RGBA strings', () => {\n    it('should convert rgba(x, y, z, a)', () => {\n      const colorFromString = processColor('rgba(10, 20, 30, 0.4)');\n      const expectedInt = 0x660a141e;\n      expect(colorFromString).toEqual(platformSpecific(expectedInt));\n    });\n  });\n\n  describe('HSL strings', () => {\n    it('should convert hsl(x, y%, z%)', () => {\n      const colorFromString = processColor('hsl(318, 69%, 55%)');\n      const expectedInt = 0xffdb3dac;\n      expect(colorFromString).toEqual(platformSpecific(expectedInt));\n    });\n  });\n\n  describe('HSLA strings', () => {\n    it('should convert hsla(x, y%, z%, a)', () => {\n      const colorFromString = processColor('hsla(318, 69%, 55%, 0.25)');\n      const expectedInt = 0x40db3dac;\n      expect(colorFromString).toEqual(platformSpecific(expectedInt));\n    });\n  });\n\n  describe('hex strings', () => {\n    it('should convert #xxxxxx', () => {\n      const colorFromString = processColor('#1e83c9');\n      const expectedInt = 0xff1e83c9;\n      expect(colorFromString).toEqual(platformSpecific(expectedInt));\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/exports/processColor/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport normalizeColor from '@react-native/normalize-colors';\n\nconst processColor = (color?: string | number): ?number => {\n  if (color === undefined || color === null) {\n    return color;\n  }\n\n  // convert number and hex\n  let int32Color = normalizeColor(color);\n  if (int32Color === undefined || int32Color === null) {\n    return undefined;\n  }\n\n  int32Color = ((int32Color << 24) | (int32Color >>> 8)) >>> 0;\n\n  return int32Color;\n};\n\nexport default processColor;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/render/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @noflow\n */\n\n'use client';\n\nimport {\n  createRoot as domCreateRoot,\n  hydrateRoot as domHydrateRoot\n} from 'react-dom/client';\n\nimport { createSheet } from '../StyleSheet/dom';\n\nexport function hydrate(element, root) {\n  createSheet(root);\n  return domHydrateRoot(root, element);\n}\n\nexport default function render(element, root) {\n  createSheet(root);\n  const reactRoot = domCreateRoot(root);\n  reactRoot.render(element);\n  return reactRoot;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/exports/unmountComponentAtNode/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @noflow\n */\n\nexport default function unmountComponentAtNode(rootTag) {\n  rootTag.unmount();\n  return true;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/exports/useColorScheme/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use client';\n\nimport * as React from 'react';\nimport type { ColorSchemeName } from '../Appearance';\nimport Appearance from '../Appearance';\n\nexport default function useColorScheme(): ColorSchemeName {\n  const [colorScheme, setColorScheme] = React.useState(\n    Appearance.getColorScheme()\n  );\n\n  React.useEffect(() => {\n    function listener(appearance) {\n      setColorScheme(appearance.colorScheme);\n    }\n    const { remove } = Appearance.addChangeListener(listener);\n    return remove;\n  });\n\n  return colorScheme;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/exports/useLocaleContext/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow strict\n */\n\n'use client';\n\nimport { useLocaleContext } from '../../modules/useLocale';\nexport default useLocaleContext;\n"
  },
  {
    "path": "packages/react-native-web/src/exports/useWindowDimensions/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * @flow strict-local\n */\n\n'use client';\n\nimport type { DisplayMetrics } from '../Dimensions';\n\nimport Dimensions from '../Dimensions';\nimport { useEffect, useState } from 'react';\n\nexport default function useWindowDimensions(): DisplayMetrics {\n  const [dims, setDims] = useState(() => Dimensions.get('window'));\n  useEffect(() => {\n    function handleChange({ window }) {\n      if (window != null) {\n        setDims(window);\n      }\n    }\n    Dimensions.addEventListener('change', handleChange);\n    // We might have missed an update between calling `get` in render and\n    // `addEventListener` in this handler, so we set it here. If there was\n    // no change, React will filter out this update as a no-op.\n    setDims(Dimensions.get('window'));\n    return () => {\n      Dimensions.removeEventListener('change', handleChange);\n    };\n  }, []);\n  return dims;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/index.js",
    "content": "// @flow strict\nexport { default as unstable_createElement } from './exports/createElement';\nexport { default as findNodeHandle } from './exports/findNodeHandle';\nexport { default as processColor } from './exports/processColor';\nexport { default as render } from './exports/render';\nexport { default as unmountComponentAtNode } from './exports/unmountComponentAtNode';\nexport { default as NativeModules } from './exports/NativeModules';\n\n// APIs\nexport { default as AccessibilityInfo } from './exports/AccessibilityInfo';\nexport { default as Alert } from './exports/Alert';\nexport { default as Animated } from './exports/Animated';\nexport { default as Appearance } from './exports/Appearance';\nexport { default as AppRegistry } from './exports/AppRegistry';\nexport { default as AppState } from './exports/AppState';\nexport { default as BackHandler } from './exports/BackHandler';\nexport { default as Clipboard } from './exports/Clipboard';\nexport { default as Dimensions } from './exports/Dimensions';\nexport { default as Easing } from './exports/Easing';\nexport { default as I18nManager } from './exports/I18nManager';\nexport { default as Keyboard } from './exports/Keyboard';\nexport { default as InteractionManager } from './exports/InteractionManager';\nexport { default as LayoutAnimation } from './exports/LayoutAnimation';\nexport { default as Linking } from './exports/Linking';\nexport { default as NativeEventEmitter } from './exports/NativeEventEmitter';\nexport { default as PanResponder } from './exports/PanResponder';\nexport { default as PixelRatio } from './exports/PixelRatio';\nexport { default as Platform } from './exports/Platform';\nexport { default as Share } from './exports/Share';\nexport { default as StyleSheet } from './exports/StyleSheet';\nexport { default as UIManager } from './exports/UIManager';\nexport { default as Vibration } from './exports/Vibration';\n\n// components\nexport { default as ActivityIndicator } from './exports/ActivityIndicator';\nexport { default as Button } from './exports/Button';\nexport { default as CheckBox } from './exports/CheckBox';\nexport { default as FlatList } from './exports/FlatList';\nexport { default as Image } from './exports/Image';\nexport { default as ImageBackground } from './exports/ImageBackground';\nexport { default as KeyboardAvoidingView } from './exports/KeyboardAvoidingView';\nexport { default as Modal } from './exports/Modal';\nexport { default as Picker } from './exports/Picker';\nexport { default as Pressable } from './exports/Pressable';\nexport { default as ProgressBar } from './exports/ProgressBar';\nexport { default as RefreshControl } from './exports/RefreshControl';\nexport { default as SafeAreaView } from './exports/SafeAreaView';\nexport { default as ScrollView } from './exports/ScrollView';\nexport { default as SectionList } from './exports/SectionList';\nexport { default as StatusBar } from './exports/StatusBar';\nexport { default as Switch } from './exports/Switch';\nexport { default as Text } from './exports/Text';\nexport { default as TextInput } from './exports/TextInput';\nexport { default as Touchable } from './exports/Touchable';\nexport { default as TouchableHighlight } from './exports/TouchableHighlight';\nexport { default as TouchableNativeFeedback } from './exports/TouchableNativeFeedback';\nexport { default as TouchableOpacity } from './exports/TouchableOpacity';\nexport { default as TouchableWithoutFeedback } from './exports/TouchableWithoutFeedback';\nexport { default as View } from './exports/View';\nexport { default as VirtualizedList } from './exports/VirtualizedList';\nexport { default as YellowBox } from './exports/YellowBox';\nexport { default as LogBox } from './exports/LogBox';\n\n// plugins\nexport { default as DeviceEventEmitter } from './exports/DeviceEventEmitter';\n\n// hooks\nexport { default as useColorScheme } from './exports/useColorScheme';\nexport { default as useLocaleContext } from './exports/useLocaleContext';\nexport { default as useWindowDimensions } from './exports/useWindowDimensions';\n"
  },
  {
    "path": "packages/react-native-web/src/modules/AccessibilityUtil/__tests__/propsToAccessibilityComponent-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport propsToAccessibilityComponent from '../propsToAccessibilityComponent';\n\ndescribe('modules/AccessibilityUtil/propsToAccessibilityComponent', () => {\n  test('when missing accessibility props\"', () => {\n    expect(propsToAccessibilityComponent({})).toBeUndefined();\n  });\n\n  test('when \"accessibilityRole\" is \"button\"', () => {\n    expect(\n      propsToAccessibilityComponent({ accessibilityRole: 'button' })\n    ).toEqual('button');\n  });\n\n  test('when \"accessibilityRole\" is \"heading\"', () => {\n    expect(\n      propsToAccessibilityComponent({ accessibilityRole: 'heading' })\n    ).toEqual('h1');\n  });\n\n  test('when \"accessibilityRole\" is \"heading\" and \"aria-level\" is set', () => {\n    expect(\n      propsToAccessibilityComponent({\n        accessibilityRole: 'heading',\n        'aria-level': 3\n      })\n    ).toEqual('h3');\n  });\n\n  test('when \"accessibilityRole\" is \"heading\" and \"accessibilityLevel\" is set', () => {\n    expect(\n      propsToAccessibilityComponent({\n        accessibilityRole: 'heading',\n        accessibilityLevel: 3\n      })\n    ).toEqual('h3');\n  });\n\n  test('when \"accessibilityRole\" is \"label\"', () => {\n    expect(\n      propsToAccessibilityComponent({ accessibilityRole: 'label' })\n    ).toEqual('label');\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/modules/AccessibilityUtil/__tests__/propsToAriaRole-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport propsToAriaRole from '../propsToAriaRole';\n\ndescribe('modules/AccessibilityUtil/propsToAriaRole', () => {\n  test('when missing accessibility props', () => {\n    expect(propsToAriaRole({})).toBeUndefined();\n  });\n\n  test('when \"role\" is defined', () => {\n    expect(propsToAriaRole({ role: 'banner' })).toEqual('banner');\n    // @deprecated\n    expect(propsToAriaRole({ accessibilityRole: 'banner' })).toEqual('banner');\n  });\n\n  test('when \"role\" is defined', () => {\n    expect(propsToAriaRole({ role: 'banner' })).toEqual('banner');\n    // @deprecated\n    expect(propsToAriaRole({ accessibilityRole: 'banner' })).toEqual('banner');\n  });\n\n  test('when \"role\" is \"none\"', () => {\n    expect(propsToAriaRole({ role: 'none' })).toEqual('presentation');\n  });\n\n  test('when \"role\" is \"label\" (non-standard)', () => {\n    expect(propsToAriaRole({ role: 'label' })).toEqual(undefined);\n  });\n\n  // @deprecated\n  test('when \"accessibilityRole\" is a native-only value', () => {\n    expect(propsToAriaRole({ accessibilityRole: 'none' })).toEqual(\n      'presentation'\n    );\n    expect(propsToAriaRole({ accessibilityRole: 'imagebutton' })).toEqual(\n      undefined\n    );\n    // not really native-only, but used to allow Web to render <label> around TextInput\n    expect(propsToAriaRole({ accessibilityRole: 'label' })).toEqual(undefined);\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/modules/AccessibilityUtil/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nimport isDisabled from './isDisabled';\nimport propsToAccessibilityComponent from './propsToAccessibilityComponent';\nimport propsToAriaRole from './propsToAriaRole';\n\nconst AccessibilityUtil = {\n  isDisabled,\n  propsToAccessibilityComponent,\n  propsToAriaRole\n};\n\nexport default AccessibilityUtil;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/AccessibilityUtil/isDisabled.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nconst isDisabled = (props: Object): boolean =>\n  props.disabled ||\n  (Array.isArray(props.accessibilityStates) &&\n    props.accessibilityStates.indexOf('disabled') > -1);\n\nexport default isDisabled;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/AccessibilityUtil/propsToAccessibilityComponent.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nimport propsToAriaRole from './propsToAriaRole';\n\nconst roleComponents = {\n  article: 'article',\n  banner: 'header',\n  blockquote: 'blockquote',\n  button: 'button',\n  code: 'code',\n  complementary: 'aside',\n  contentinfo: 'footer',\n  deletion: 'del',\n  emphasis: 'em',\n  figure: 'figure',\n  insertion: 'ins',\n  form: 'form',\n  list: 'ul',\n  listitem: 'li',\n  main: 'main',\n  navigation: 'nav',\n  paragraph: 'p',\n  region: 'section',\n  strong: 'strong'\n};\n\nconst emptyObject = {};\n\nconst propsToAccessibilityComponent = (\n  props: Object = emptyObject\n): void | string => {\n  const roleProp = props.role || props.accessibilityRole;\n  // special-case for \"label\" role which doesn't map to an ARIA role\n  if (roleProp === 'label') {\n    return 'label';\n  }\n\n  const role = propsToAriaRole(props);\n  if (role) {\n    if (role === 'heading') {\n      const level = props.accessibilityLevel || props['aria-level'];\n      if (level != null) {\n        return `h${level}`;\n      }\n      return 'h1';\n    }\n    return roleComponents[role];\n  }\n};\n\nexport default propsToAccessibilityComponent;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/AccessibilityUtil/propsToAriaRole.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nconst accessibilityRoleToWebRole = {\n  adjustable: 'slider',\n  button: 'button',\n  header: 'heading',\n  image: 'img',\n  imagebutton: null,\n  keyboardkey: null,\n  label: null,\n  link: 'link',\n  none: 'presentation',\n  search: 'search',\n  summary: 'region',\n  text: null\n};\n\nconst propsToAriaRole = ({\n  accessibilityRole,\n  role\n}: {\n  accessibilityRole?: string,\n  role?: string\n}): string | void => {\n  const _role = role || accessibilityRole;\n  if (_role) {\n    const inferredRole = accessibilityRoleToWebRole[_role];\n    if (inferredRole !== null) {\n      // ignore roles that don't map to web\n      return inferredRole || _role;\n    }\n  }\n};\n\nexport default propsToAriaRole;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/AssetRegistry/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nexport type PackagerAsset = {\n  __packager_asset: boolean,\n  fileSystemLocation: string,\n  httpServerLocation: string,\n  width: ?number,\n  height: ?number,\n  scales: Array<number>,\n  hash: string,\n  name: string,\n  type: string\n};\n\nconst assets: Array<PackagerAsset> = [];\n\nexport function registerAsset(asset: PackagerAsset): number {\n  // `push` returns new array length, so the first asset will\n  // get id 1 (not 0) to make the value truthy\n  return assets.push(asset);\n}\n\nexport function getAssetByID(assetId: number): PackagerAsset {\n  return assets[assetId - 1];\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/ImageLoader/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nconst dataUriPattern = /^data:/;\n\nexport class ImageUriCache {\n  static _maximumEntries: number = 256;\n  static _entries = {};\n\n  static has(uri: string): boolean {\n    const entries = ImageUriCache._entries;\n    const isDataUri = dataUriPattern.test(uri);\n    return isDataUri || Boolean(entries[uri]);\n  }\n\n  static add(uri: string) {\n    const entries = ImageUriCache._entries;\n    const lastUsedTimestamp = Date.now();\n    if (entries[uri]) {\n      entries[uri].lastUsedTimestamp = lastUsedTimestamp;\n      entries[uri].refCount += 1;\n    } else {\n      entries[uri] = {\n        lastUsedTimestamp,\n        refCount: 1\n      };\n    }\n  }\n\n  static remove(uri: string) {\n    const entries = ImageUriCache._entries;\n    if (entries[uri]) {\n      entries[uri].refCount -= 1;\n    }\n    // Free up entries when the cache is \"full\"\n    ImageUriCache._cleanUpIfNeeded();\n  }\n\n  static _cleanUpIfNeeded() {\n    const entries = ImageUriCache._entries;\n    const imageUris = Object.keys(entries);\n\n    if (imageUris.length + 1 > ImageUriCache._maximumEntries) {\n      let leastRecentlyUsedKey;\n      let leastRecentlyUsedEntry;\n\n      imageUris.forEach((uri) => {\n        const entry = entries[uri];\n        if (\n          (!leastRecentlyUsedEntry ||\n            entry.lastUsedTimestamp <\n              leastRecentlyUsedEntry.lastUsedTimestamp) &&\n          entry.refCount === 0\n        ) {\n          leastRecentlyUsedKey = uri;\n          leastRecentlyUsedEntry = entry;\n        }\n      });\n\n      if (leastRecentlyUsedKey) {\n        delete entries[leastRecentlyUsedKey];\n      }\n    }\n  }\n}\n\nlet id = 0;\nconst requests = {};\n\nconst ImageLoader = {\n  abort(requestId: number) {\n    let image = requests[`${requestId}`];\n    if (image) {\n      image.onerror = null;\n      image.onload = null;\n      image = null;\n      delete requests[`${requestId}`];\n    }\n  },\n  getSize(\n    uri: string,\n    success: (width: number, height: number) => void,\n    failure: () => void\n  ) {\n    let complete = false;\n    const interval = setInterval(callback, 16);\n    const requestId = ImageLoader.load(uri, callback, errorCallback);\n\n    function callback() {\n      const image = requests[`${requestId}`];\n      if (image) {\n        const { naturalHeight, naturalWidth } = image;\n        if (naturalHeight && naturalWidth) {\n          success(naturalWidth, naturalHeight);\n          complete = true;\n        }\n      }\n      if (complete) {\n        ImageLoader.abort(requestId);\n        clearInterval(interval);\n      }\n    }\n\n    function errorCallback() {\n      if (typeof failure === 'function') {\n        failure();\n      }\n      ImageLoader.abort(requestId);\n      clearInterval(interval);\n    }\n  },\n  has(uri: string): boolean {\n    return ImageUriCache.has(uri);\n  },\n  load(uri: string, onLoad: Function, onError: Function): number {\n    id += 1;\n    const image = new window.Image();\n    image.onerror = onError;\n    image.onload = (e) => {\n      // avoid blocking the main thread\n      const onDecode = () => onLoad({ nativeEvent: e });\n      if (typeof image.decode === 'function') {\n        // Safari currently throws exceptions when decoding svgs.\n        // We want to catch that error and allow the load handler\n        // to be forwarded to the onLoad handler in this case\n        image.decode().then(onDecode, onDecode);\n      } else {\n        setTimeout(onDecode, 0);\n      }\n    };\n    image.src = uri;\n    requests[`${id}`] = image;\n    return id;\n  },\n  prefetch(uri: string): Promise<void> {\n    return new Promise((resolve, reject) => {\n      ImageLoader.load(\n        uri,\n        () => {\n          // Add the uri to the cache so it can be immediately displayed when used\n          // but also immediately remove it to correctly reflect that it has no active references\n          ImageUriCache.add(uri);\n          ImageUriCache.remove(uri);\n          resolve();\n        },\n        reject\n      );\n    });\n  },\n  queryCache(uris: Array<string>): Promise<{| [uri: string]: 'disk/memory' |}> {\n    const result = {};\n    uris.forEach((u) => {\n      if (ImageUriCache.has(u)) {\n        result[u] = 'disk/memory';\n      }\n    });\n    return Promise.resolve(result);\n  }\n};\n\nexport default ImageLoader;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/TextInputState/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport UIManager from '../../exports/UIManager';\n\n/**\n * This class is responsible for coordinating the \"focused\"\n * state for TextInputs. All calls relating to the keyboard\n * should be funneled through here\n */\nconst TextInputState = {\n  /**\n   * Internal state\n   */\n  _currentlyFocusedNode: (null: ?Object),\n\n  /**\n   * Returns the ID of the currently focused text field, if one exists\n   * If no text field is focused it returns null\n   */\n  currentlyFocusedField(): ?Object {\n    if (document.activeElement !== this._currentlyFocusedNode) {\n      this._currentlyFocusedNode = null;\n    }\n    return this._currentlyFocusedNode;\n  },\n\n  /**\n   * @param {Object} TextInputID id of the text field to focus\n   * Focuses the specified text field\n   * noop if the text field was already focused\n   */\n  focusTextInput(textFieldNode: ?Object) {\n    if (textFieldNode !== null) {\n      this._currentlyFocusedNode = textFieldNode;\n      if (document.activeElement !== textFieldNode) {\n        UIManager.focus(textFieldNode);\n      }\n    }\n  },\n\n  /**\n   * @param {Object} textFieldNode id of the text field to focus\n   * Unfocuses the specified text field\n   * noop if it wasn't focused\n   */\n  blurTextInput(textFieldNode: ?Object) {\n    if (textFieldNode !== null) {\n      this._currentlyFocusedNode = null;\n      if (document.activeElement === textFieldNode) {\n        UIManager.blur(textFieldNode);\n      }\n    }\n  }\n};\n\nexport default TextInputState;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/UnimplementedView/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\nimport type { Node } from 'React';\nimport type { ViewProps } from '../../exports/View/types';\n\nimport View from '../../exports/View';\nimport React from 'react';\n\n/**\n * Common implementation for a simple stubbed view.\n */\nfunction UnimplementedView({ style, ...props }: ViewProps): Node {\n  return <View {...props} style={[unimplementedViewStyles, style]} />;\n}\n\nconst unimplementedViewStyles =\n  process.env.NODE_ENV !== 'production'\n    ? {\n        alignSelf: 'flex-start',\n        borderColor: 'red',\n        borderWidth: 1\n      }\n    : {};\n\nexport default UnimplementedView;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/addEventListener/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n */\n\nimport * as React from 'react';\nimport { act, render } from '@testing-library/react';\nimport { createEventTarget } from 'dom-event-testing-library';\nimport { addEventListener } from '..';\n\ndescribe('addEventListener', () => {\n  describe('addEventListener()', () => {\n    test('event dispatched on target', () => {\n      const listener = jest.fn();\n      const targetRef = React.createRef();\n\n      function Component() {\n        React.useEffect(() => {\n          return addEventListener(targetRef.current, 'click', listener);\n        });\n        return <div ref={targetRef} />;\n      }\n\n      render(<Component />);\n\n      const target = createEventTarget(targetRef.current);\n\n      act(() => {\n        target.click();\n      });\n\n      expect(listener).toBeCalledTimes(1);\n    });\n\n    test('event dispatched on parent', () => {\n      const listener = jest.fn();\n      const listenerCapture = jest.fn();\n      const targetRef = React.createRef();\n      const parentRef = React.createRef();\n\n      function Component() {\n        React.useEffect(() => {\n          const removeClickListener = addEventListener(\n            targetRef.current,\n            'click',\n            listener\n          );\n          const removeClickCaptureListener = addEventListener(\n            targetRef.current,\n            'click',\n            listenerCapture,\n            { capture: true }\n          );\n          return () => {\n            removeClickListener();\n            removeClickCaptureListener();\n          };\n        });\n        return (\n          <div ref={parentRef}>\n            <div ref={targetRef} />\n          </div>\n        );\n      }\n\n      render(<Component />);\n\n      const parent = createEventTarget(parentRef.current);\n\n      act(() => {\n        parent.click();\n      });\n\n      expect(listener).toBeCalledTimes(0);\n      expect(listenerCapture).toBeCalledTimes(0);\n    });\n\n    test('event dispatched on child', () => {\n      const log = [];\n      const listener = jest.fn(() => {\n        log.push('bubble');\n      });\n      const listenerCapture = jest.fn(() => {\n        log.push('capture');\n      });\n      const targetRef = React.createRef();\n      const childRef = React.createRef();\n\n      function Component() {\n        React.useEffect(() => {\n          const removeClickListener = addEventListener(\n            targetRef.current,\n            'click',\n            listener\n          );\n          const removeClickCaptureListener = addEventListener(\n            targetRef.current,\n            'click',\n            listenerCapture,\n            { capture: true }\n          );\n          return () => {\n            removeClickListener();\n            removeClickCaptureListener();\n          };\n        });\n        return (\n          <div ref={targetRef}>\n            <div ref={childRef} />\n          </div>\n        );\n      }\n\n      render(<Component />);\n\n      const child = createEventTarget(childRef.current);\n\n      act(() => {\n        child.click();\n      });\n\n      expect(listenerCapture).toBeCalledTimes(1);\n      expect(listener).toBeCalledTimes(1);\n      expect(log).toEqual(['capture', 'bubble']);\n    });\n\n    test('event dispatched on text node', () => {\n      const listener = jest.fn();\n      const targetRef = React.createRef();\n      const childRef = React.createRef();\n\n      function Component() {\n        React.useEffect(() => {\n          return addEventListener(targetRef.current, 'click', listener);\n        });\n        return (\n          <div ref={targetRef}>\n            <div ref={childRef}>text</div>\n          </div>\n        );\n      }\n\n      render(<Component />);\n\n      const text = createEventTarget(childRef.current.firstChild);\n\n      act(() => {\n        text.click();\n      });\n\n      expect(listener).toBeCalledTimes(1);\n    });\n\n    test('listener can be attached to document', () => {\n      const listener = jest.fn();\n      const targetRef = React.createRef();\n\n      function Component({ target }) {\n        React.useEffect(() => {\n          return addEventListener(target, 'click', listener);\n        });\n        return <div ref={targetRef} />;\n      }\n\n      render(<Component target={document} />);\n\n      const target = createEventTarget(targetRef.current);\n      act(() => {\n        target.click();\n      });\n\n      expect(listener).toBeCalledTimes(1);\n    });\n\n    test('listener can be attached to window ', () => {\n      const listener = jest.fn();\n      const targetRef = React.createRef();\n\n      function Component({ target }) {\n        React.useEffect(() => {\n          return addEventListener(target, 'click', listener);\n        });\n        return <div ref={targetRef} />;\n      }\n\n      render(<Component target={window} />);\n\n      const target = createEventTarget(targetRef.current);\n      act(() => {\n        target.click();\n      });\n\n      expect(listener).toBeCalledTimes(1);\n    });\n\n    test('custom event dispatched on target', () => {\n      const listener = jest.fn();\n      const targetRef = React.createRef();\n\n      function Component() {\n        React.useEffect(() => {\n          return addEventListener(targetRef.current, 'magic-event', listener);\n        });\n        return <div ref={targetRef} />;\n      }\n\n      render(<Component />);\n\n      act(() => {\n        const event = new CustomEvent('magic-event', { bubbles: true });\n        targetRef.current.dispatchEvent(event);\n      });\n\n      expect(listener).toBeCalledTimes(1);\n    });\n\n    test('listeners can be set on multiple targets simultaneously', () => {\n      const log = [];\n      const targetRef = React.createRef();\n      const parentRef = React.createRef();\n      const childRef = React.createRef();\n\n      const listener = jest.fn((e) => {\n        log.push(['bubble', e.currentTarget.id]);\n      });\n      const listenerCapture = jest.fn((e) => {\n        log.push(['capture', e.currentTarget.id]);\n      });\n\n      function Component() {\n        React.useEffect(() => {\n          // the same event handle is used to set listeners on different targets\n          addEventListener(targetRef.current, 'click', listener);\n          addEventListener(parentRef.current, 'click', listener);\n          addEventListener(targetRef.current, 'click', listenerCapture, {\n            capture: true\n          });\n          addEventListener(parentRef.current, 'click', listenerCapture, {\n            capture: true\n          });\n        });\n        return (\n          <div id=\"parent\" ref={parentRef}>\n            <div id=\"target\" ref={targetRef}>\n              <div ref={childRef} />\n            </div>\n          </div>\n        );\n      }\n\n      render(<Component />);\n\n      const child = createEventTarget(childRef.current);\n\n      act(() => {\n        child.click();\n      });\n\n      expect(listenerCapture).toBeCalledTimes(2);\n      expect(listener).toBeCalledTimes(2);\n      expect(log).toEqual([\n        ['capture', 'parent'],\n        ['capture', 'target'],\n        ['bubble', 'target'],\n        ['bubble', 'parent']\n      ]);\n    });\n\n    test('listeners are specific to each event handle', () => {\n      const log = [];\n      const targetRef = React.createRef();\n      const childRef = React.createRef();\n      const listener = jest.fn((e) => {\n        log.push(['bubble', 'target']);\n      });\n      const listenerAlt = jest.fn((e) => {\n        log.push(['bubble', 'target-alt']);\n      });\n      const listenerCapture = jest.fn((e) => {\n        log.push(['capture', 'target']);\n      });\n      const listenerCaptureAlt = jest.fn((e) => {\n        log.push(['capture', 'target-alt']);\n      });\n\n      function Component() {\n        React.useEffect(() => {\n          addEventListener(targetRef.current, 'click', listener);\n          addEventListener(targetRef.current, 'click', listenerAlt);\n          addEventListener(targetRef.current, 'click', listenerCapture, {\n            capture: true\n          });\n          addEventListener(targetRef.current, 'click', listenerCaptureAlt, {\n            capture: true\n          });\n        });\n        return (\n          <div id=\"target\" ref={targetRef}>\n            <div ref={childRef} />\n          </div>\n        );\n      }\n\n      render(<Component />);\n\n      const child = createEventTarget(childRef.current);\n\n      act(() => {\n        child.click();\n      });\n\n      expect(listenerCapture).toBeCalledTimes(1);\n      expect(listenerCaptureAlt).toBeCalledTimes(1);\n      expect(listener).toBeCalledTimes(1);\n      expect(listenerAlt).toBeCalledTimes(1);\n      expect(log).toEqual([\n        ['capture', 'target'],\n        ['capture', 'target-alt'],\n        ['bubble', 'target'],\n        ['bubble', 'target-alt']\n      ]);\n    });\n  });\n\n  describe('stopPropagation and stopImmediatePropagation', () => {\n    test('stopPropagation works as expected', () => {\n      const childListener = jest.fn((e) => {\n        e.stopPropagation();\n      });\n      const targetListener = jest.fn();\n      const targetRef = React.createRef();\n      const childRef = React.createRef();\n\n      function Component() {\n        React.useEffect(() => {\n          addEventListener(childRef.current, 'click', childListener);\n          addEventListener(targetRef.current, 'click', targetListener);\n        });\n        return (\n          <div ref={targetRef}>\n            <div ref={childRef} />\n          </div>\n        );\n      }\n\n      render(<Component />);\n\n      const child = createEventTarget(childRef.current);\n\n      act(() => {\n        child.click();\n      });\n\n      expect(childListener).toBeCalledTimes(1);\n      expect(targetListener).toBeCalledTimes(0);\n    });\n\n    test('stopImmediatePropagation works as expected', () => {\n      const firstListener = jest.fn((e) => {\n        e.stopImmediatePropagation();\n      });\n      const secondListener = jest.fn();\n      const targetRef = React.createRef();\n\n      function Component() {\n        React.useEffect(() => {\n          addEventListener(targetRef.current, 'click', firstListener);\n          addEventListener(targetRef.current, 'click', secondListener);\n        });\n        return <div ref={targetRef} />;\n      }\n\n      render(<Component />);\n\n      const target = createEventTarget(targetRef.current);\n\n      act(() => {\n        target.click();\n      });\n\n      expect(firstListener).toBeCalledTimes(1);\n      expect(secondListener).toBeCalledTimes(0);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/modules/addEventListener/__tests__/index-test.node.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n */\n\nimport * as React from 'react';\nimport * as ReactDOMServer from 'react-dom/server';\nimport { addEventListener } from '..';\n\ndescribe('addEventListener', () => {\n  test('can render correctly using ReactDOMServer', () => {\n    const listener = jest.fn();\n    const targetRef = React.createRef();\n\n    function Component() {\n      React.useEffect(() => {\n        return addEventListener(targetRef.current, 'click', listener);\n      });\n      return <div ref={targetRef} />;\n    }\n\n    const output = ReactDOMServer.renderToString(<Component />);\n    expect(output).toBe('<div></div>');\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/modules/addEventListener/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\n'use strict';\nimport canUseDOM from '../canUseDom';\n\ntype Listener = (e: any) => void;\n\nexport type EventOptions = {\n  capture?: boolean,\n  passive?: boolean,\n  once?: boolean\n};\n\nconst emptyFunction = () => {};\n\nfunction supportsPassiveEvents(): boolean {\n  let supported = false;\n  // Check if browser supports event with passive listeners\n  // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n  if (canUseDOM) {\n    try {\n      const options = {};\n      Object.defineProperty(options, 'passive', {\n        get() {\n          supported = true;\n          return false;\n        }\n      });\n      window.addEventListener('test', null, options);\n      window.removeEventListener('test', null, options);\n    } catch (e) {}\n  }\n  return supported;\n}\n\nconst canUsePassiveEvents = supportsPassiveEvents();\n\nfunction getOptions(options: ?EventOptions): EventOptions | boolean {\n  if (options == null) {\n    return false;\n  }\n  return canUsePassiveEvents ? options : Boolean(options.capture);\n}\n\n/**\n * Shim generic API compatibility with ReactDOM's synthetic events, without needing the\n * large amount of code ReactDOM uses to do this. Ideally we wouldn't use a synthetic\n * event wrapper at all.\n */\nfunction isPropagationStopped() {\n  return this.cancelBubble;\n}\nfunction isDefaultPrevented() {\n  return this.defaultPrevented;\n}\nfunction normalizeEvent(event: any) {\n  event.nativeEvent = event;\n  event.persist = emptyFunction;\n  event.isDefaultPrevented = isDefaultPrevented;\n  event.isPropagationStopped = isPropagationStopped;\n  return event;\n}\n\n/**\n *\n */\nexport function addEventListener(\n  target: EventTarget,\n  type: any,\n  listener: Listener,\n  options: ?EventOptions\n): () => void {\n  const opts = getOptions(options);\n  const compatListener = (e: any) => listener(normalizeEvent(e));\n  target.addEventListener(type, compatListener, opts);\n\n  return function removeEventListener() {\n    if (target != null) {\n      target.removeEventListener(type, compatListener, opts);\n    }\n  };\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/canUseDom/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict\n */\n\nconst canUseDOM: boolean = !!(\n  typeof window !== 'undefined' &&\n  window.document &&\n  window.document.createElement\n);\n\nexport default canUseDOM;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/createDOMProps/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport createDOMProps from '..';\n\nconst createProps = (props) => createDOMProps(null, props);\n\ndescribe('modules/createDOMProps', () => {\n  test('web props', () => {\n    const props = {\n      'aria-activedescendant': 'activedescendant',\n      'aria-atomic': true,\n      'aria-autocomplete': 'list',\n      'aria-busy': true,\n      'aria-checked': true,\n      'aria-columncount': 5,\n      'aria-columnindex': 3,\n      'aria-columnspan': 2,\n      'aria-controls': 'controls',\n      'aria-current': 'current',\n      'aria-describedby': 'describedby',\n      'aria-details': 'details',\n      'aria-disabled': true,\n      'aria-errormessage': 'errormessage',\n      'aria-expanded': true,\n      'aria-flowto': 'flowto',\n      'aria-haspopup': true,\n      'aria-hidden': true,\n      'aria-invalid': true,\n      'aria-keyshortcuts': 'Cmd+S',\n      'aria-label': 'label',\n      'aria-labelledby': 'labelledby',\n      'aria-level': 3,\n      'aria-live': 'polite',\n      'aria-modal': true,\n      'aria-multiline': true,\n      'aria-multiselectable': true,\n      'aria-orientation': 'portrait',\n      'aria-owns': 'owns',\n      'aria-placeholder': 'placeholder',\n      'aria-posinset': 5,\n      'aria-pressed': true,\n      'aria-readonly': true,\n      'aria-required': true,\n      role: 'main',\n      'aria-roledescription': 'roledescription',\n      'aria-rowcount': 5,\n      'aria-rowindex': 3,\n      'aria-rowspan': 3,\n      'aria-selected': true,\n      'aria-setsize': 5,\n      'aria-sort': 'ascending',\n      'aria-valuemax': 5,\n      'aria-valuemin': 0,\n      'aria-valuenow': 3,\n      'aria-valuetext': '3',\n      className: 'className',\n      dataSet: {\n        custom: 'custom'\n      },\n      id: 'id',\n      tabIndex: 0,\n      testID: 'testID'\n    };\n\n    const _props = createProps(props);\n    expect(_props).toMatchInlineSnapshot(`\n      {\n        \"aria-activedescendant\": \"activedescendant\",\n        \"aria-atomic\": \"activedescendant\",\n        \"aria-autocomplete\": \"list\",\n        \"aria-busy\": true,\n        \"aria-checked\": true,\n        \"aria-columncount\": 5,\n        \"aria-columnindex\": 3,\n        \"aria-columnspan\": 2,\n        \"aria-controls\": \"controls\",\n        \"aria-current\": \"current\",\n        \"aria-describedby\": \"describedby\",\n        \"aria-details\": \"details\",\n        \"aria-disabled\": true,\n        \"aria-errormessage\": \"errormessage\",\n        \"aria-expanded\": true,\n        \"aria-flowto\": \"flowto\",\n        \"aria-haspopup\": true,\n        \"aria-hidden\": true,\n        \"aria-invalid\": true,\n        \"aria-keyshortcuts\": \"Cmd+S\",\n        \"aria-label\": \"label\",\n        \"aria-labelledby\": \"labelledby\",\n        \"aria-level\": 3,\n        \"aria-live\": \"polite\",\n        \"aria-modal\": true,\n        \"aria-multiline\": true,\n        \"aria-multiselectable\": true,\n        \"aria-orientation\": \"portrait\",\n        \"aria-owns\": \"owns\",\n        \"aria-placeholder\": \"placeholder\",\n        \"aria-posinset\": 5,\n        \"aria-pressed\": true,\n        \"aria-readonly\": true,\n        \"aria-required\": true,\n        \"aria-roledescription\": \"roledescription\",\n        \"aria-rowcount\": 5,\n        \"aria-rowindex\": 3,\n        \"aria-rowspan\": 3,\n        \"aria-selected\": true,\n        \"aria-setsize\": 5,\n        \"aria-sort\": \"ascending\",\n        \"aria-valuemax\": 5,\n        \"aria-valuemin\": 0,\n        \"aria-valuenow\": 3,\n        \"aria-valuetext\": \"3\",\n        \"className\": \"className\",\n        \"data-custom\": \"custom\",\n        \"data-testid\": \"testID\",\n        \"id\": \"id\",\n        \"role\": \"main\",\n        \"tabIndex\": 0,\n      }\n    `);\n  });\n\n  // @deprecated\n  describe('focus-related accessibility attributes', () => {\n    test('with no accessibility props', () => {\n      expect(createProps({})).toEqual({});\n    });\n\n    describe('\"accessibilityRole\" of \"link\"', () => {\n      const accessibilityRole = 'link';\n\n      test('default case', () => {\n        expect(createProps({ accessibilityRole })).toEqual(\n          expect.not.objectContaining({ tabIndex: '-1' })\n        );\n      });\n\n      test('when \"focusable\" is true', () => {\n        expect(createProps({ accessibilityRole, focusable: true })).toEqual(\n          expect.not.objectContaining({ tabIndex: '-1' })\n        );\n      });\n\n      test('when \"focusable\" is false', () => {\n        expect(createProps({ accessibilityRole, focusable: false })).toEqual(\n          expect.objectContaining({ tabIndex: '-1' })\n        );\n      });\n\n      test('when \"accessibilityDisabled\" is true', () => {\n        expect(\n          createProps({ accessibilityRole, accessibilityDisabled: true })\n        ).toEqual(expect.objectContaining({ 'aria-disabled': true }));\n      });\n\n      test('when \"disabled\" is false', () => {\n        expect(\n          createProps({ accessibilityRole, accessibilityDisabled: false })\n        ).toEqual(expect.not.objectContaining({ tabIndex: '-1' }));\n      });\n    });\n\n    const testFocusableRole = (accessibilityRole) => {\n      test('default case', () => {\n        expect(createProps({ accessibilityRole })).toEqual(\n          expect.objectContaining({ tabIndex: '0' })\n        );\n      });\n\n      test('when \"focusable\" is true', () => {\n        expect(createProps({ accessibilityRole, focusable: true })).toEqual(\n          expect.objectContaining({ tabIndex: '0' })\n        );\n      });\n\n      test('when \"focusable\" is false', () => {\n        expect(createProps({ accessibilityRole, focusable: false })).toEqual(\n          expect.objectContaining({ tabIndex: '-1' })\n        );\n      });\n\n      test('when \"accessibilityDisabled\" is true', () => {\n        expect(\n          createProps({ accessibilityRole, accessibilityDisabled: true })\n        ).toEqual(expect.objectContaining({ 'aria-disabled': true }));\n      });\n\n      test('when \"accessibilityDisabled\" is false', () => {\n        expect(\n          createProps({ accessibilityRole, accessibilityDisabled: false })\n        ).toEqual(expect.objectContaining({ tabIndex: '0' }));\n      });\n    };\n\n    describe('\"accessibilityRole\" of \"button\"', () => {\n      testFocusableRole('button');\n    });\n\n    describe('with unfocusable accessibilityRole', () => {\n      test('when \"focusable\" is true', () => {\n        expect(createProps({ focusable: true })).toEqual(\n          expect.objectContaining({ tabIndex: '0' })\n        );\n      });\n\n      test('when \"focusable\" is false', () => {\n        expect(createProps({ focusable: false })).toEqual(\n          expect.objectContaining({ tabIndex: '-1' })\n        );\n      });\n    });\n  });\n\n  test('prop \"accessibilityLabel\" becomes \"aria-label\"', () => {\n    const accessibilityLabel = 'accessibilityLabel';\n    const props = createProps({ accessibilityLabel });\n    expect(props['aria-label']).toEqual(accessibilityLabel);\n  });\n\n  test('prop \"accessibilityLiveRegion\" becomes \"aria-live\"', () => {\n    const accessibilityLiveRegion = 'none';\n    const props = createProps({ accessibilityLiveRegion });\n    expect(props['aria-live']).toEqual('off');\n  });\n\n  test('prop \"accessibilityRequired\" becomes \"aria-required\" and \"required\"', () => {\n    const accessibilityRequired = false;\n    const props = createDOMProps('input', { accessibilityRequired });\n    expect(props['aria-required']).toEqual(false);\n    expect(props.required).toEqual(false);\n  });\n\n  test('prop \"accessibilityRole\" becomes \"role\"', () => {\n    const accessibilityRole = 'button';\n    const props = createProps({ accessibilityRole });\n    expect(props.role).toEqual('button');\n  });\n\n  test('prop \"nativeID\" becomes \"id\"', () => {\n    const nativeID = 'Example.nativeID';\n    const props = createProps({ nativeID });\n    expect(props.id).toEqual(nativeID);\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/modules/createDOMProps/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @noflow\n */\n\nimport AccessibilityUtil from '../AccessibilityUtil';\nimport StyleSheet from '../../exports/StyleSheet';\nimport { warnOnce } from '../warnOnce';\n\nconst emptyObject = {};\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\nconst isArray = Array.isArray;\n\nconst uppercasePattern = /[A-Z]/g;\nfunction toHyphenLower(match) {\n  return '-' + match.toLowerCase();\n}\nfunction hyphenateString(str: string): string {\n  return str.replace(uppercasePattern, toHyphenLower);\n}\nfunction processIDRefList(idRefList: string | Array<string>): string {\n  return isArray(idRefList) ? idRefList.join(' ') : idRefList;\n}\n\nconst pointerEventsStyles = StyleSheet.create({\n  auto: {\n    pointerEvents: 'auto'\n  },\n  'box-none': {\n    pointerEvents: 'box-none'\n  },\n  'box-only': {\n    pointerEvents: 'box-only'\n  },\n  none: {\n    pointerEvents: 'none'\n  }\n});\n\nconst createDOMProps = (elementType, props, options) => {\n  if (!props) {\n    props = emptyObject;\n  }\n\n  const {\n    'aria-activedescendant': ariaActiveDescendant,\n    accessibilityActiveDescendant,\n    'aria-atomic': ariaAtomic,\n    accessibilityAtomic,\n    'aria-autocomplete': ariaAutoComplete,\n    accessibilityAutoComplete,\n    'aria-busy': ariaBusy,\n    accessibilityBusy,\n    'aria-checked': ariaChecked,\n    accessibilityChecked,\n    'aria-colcount': ariaColumnCount,\n    accessibilityColumnCount,\n    'aria-colindex': ariaColumnIndex,\n    accessibilityColumnIndex,\n    'aria-colspan': ariaColumnSpan,\n    accessibilityColumnSpan,\n    'aria-controls': ariaControls,\n    accessibilityControls,\n    'aria-current': ariaCurrent,\n    accessibilityCurrent,\n    'aria-describedby': ariaDescribedBy,\n    accessibilityDescribedBy,\n    'aria-details': ariaDetails,\n    accessibilityDetails,\n    'aria-disabled': ariaDisabled,\n    accessibilityDisabled,\n    'aria-errormessage': ariaErrorMessage,\n    accessibilityErrorMessage,\n    'aria-expanded': ariaExpanded,\n    accessibilityExpanded,\n    'aria-flowto': ariaFlowTo,\n    accessibilityFlowTo,\n    'aria-haspopup': ariaHasPopup,\n    accessibilityHasPopup,\n    'aria-hidden': ariaHidden,\n    accessibilityHidden,\n    'aria-invalid': ariaInvalid,\n    accessibilityInvalid,\n    'aria-keyshortcuts': ariaKeyShortcuts,\n    accessibilityKeyShortcuts,\n    'aria-label': ariaLabel,\n    accessibilityLabel,\n    'aria-labelledby': ariaLabelledBy,\n    accessibilityLabelledBy,\n    'aria-level': ariaLevel,\n    accessibilityLevel,\n    'aria-live': ariaLive,\n    accessibilityLiveRegion,\n    'aria-modal': ariaModal,\n    accessibilityModal,\n    'aria-multiline': ariaMultiline,\n    accessibilityMultiline,\n    'aria-multiselectable': ariaMultiSelectable,\n    accessibilityMultiSelectable,\n    'aria-orientation': ariaOrientation,\n    accessibilityOrientation,\n    'aria-owns': ariaOwns,\n    accessibilityOwns,\n    'aria-placeholder': ariaPlaceholder,\n    accessibilityPlaceholder,\n    'aria-posinset': ariaPosInSet,\n    accessibilityPosInSet,\n    'aria-pressed': ariaPressed,\n    accessibilityPressed,\n    'aria-readonly': ariaReadOnly,\n    accessibilityReadOnly,\n    'aria-required': ariaRequired,\n    accessibilityRequired,\n    /* eslint-disable */\n    role: ariaRole,\n    accessibilityRole,\n    /* eslint-enable */\n    'aria-roledescription': ariaRoleDescription,\n    accessibilityRoleDescription,\n    'aria-rowcount': ariaRowCount,\n    accessibilityRowCount,\n    'aria-rowindex': ariaRowIndex,\n    accessibilityRowIndex,\n    'aria-rowspan': ariaRowSpan,\n    accessibilityRowSpan,\n    'aria-selected': ariaSelected,\n    accessibilitySelected,\n    'aria-setsize': ariaSetSize,\n    accessibilitySetSize,\n    'aria-sort': ariaSort,\n    accessibilitySort,\n    'aria-valuemax': ariaValueMax,\n    accessibilityValueMax,\n    'aria-valuemin': ariaValueMin,\n    accessibilityValueMin,\n    'aria-valuenow': ariaValueNow,\n    accessibilityValueNow,\n    'aria-valuetext': ariaValueText,\n    accessibilityValueText,\n    dataSet,\n    focusable,\n    id,\n    nativeID,\n    pointerEvents,\n    style,\n    tabIndex,\n    testID,\n    // Rest\n    ...domProps\n  } = props;\n\n  /*\n  if (accessibilityDisabled != null) {\n    warnOnce('accessibilityDisabled', `accessibilityDisabled is deprecated.`);\n  }\n  */\n  const disabled = ariaDisabled || accessibilityDisabled;\n\n  const role = AccessibilityUtil.propsToAriaRole(props);\n\n  // ACCESSIBILITY\n  /*\n  if (accessibilityActiveDescendant != null) {\n    warnOnce(\n      'accessibilityActiveDescendant',\n      `accessibilityActiveDescendant is deprecated. Use aria-activedescendant.`\n    );\n  }\n  */\n  const _ariaActiveDescendant =\n    ariaActiveDescendant != null\n      ? ariaActiveDescendant\n      : accessibilityActiveDescendant;\n  if (_ariaActiveDescendant != null) {\n    domProps['aria-activedescendant'] = _ariaActiveDescendant;\n  }\n\n  /*\n  if (accessibilityAtomic != null) {\n    warnOnce(\n      'accessibilityAtomic',\n      `accessibilityAtomic is deprecated. Use aria-atomic.`\n    );\n  }\n  */\n  const _ariaAtomic =\n    ariaAtomic != null ? ariaActiveDescendant : accessibilityAtomic;\n  if (_ariaAtomic != null) {\n    domProps['aria-atomic'] = _ariaAtomic;\n  }\n\n  /*\n  if (accessibilityAutoComplete != null) {\n    warnOnce(\n      'accessibilityAutoComplete',\n      `accessibilityAutoComplete is deprecated. Use aria-autocomplete.`\n    );\n  }\n  */\n  const _ariaAutoComplete =\n    ariaAutoComplete != null ? ariaAutoComplete : accessibilityAutoComplete;\n  if (_ariaAutoComplete != null) {\n    domProps['aria-autocomplete'] = _ariaAutoComplete;\n  }\n\n  /*\n  if (accessibilityBusy != null) {\n    warnOnce(\n      'accessibilityBusy',\n      `accessibilityBusy is deprecated. Use aria-busy.`\n    );\n  }\n  */\n  const _ariaBusy = ariaBusy != null ? ariaBusy : accessibilityBusy;\n  if (_ariaBusy != null) {\n    domProps['aria-busy'] = _ariaBusy;\n  }\n\n  /*\n  if (accessibilityChecked != null) {\n    warnOnce(\n      'accessibilityChecked',\n      `accessibilityChecked is deprecated. Use aria-checked.`\n    );\n  }\n  */\n  const _ariaChecked = ariaChecked != null ? ariaChecked : accessibilityChecked;\n  if (_ariaChecked != null) {\n    domProps['aria-checked'] = _ariaChecked;\n  }\n\n  /*\n  if (accessibilityColumnCount != null) {\n    warnOnce(\n      'accessibilityColumnCount',\n      `accessibilityColumnCount is deprecated. Use aria-colcount.`\n    );\n  }\n  */\n  const _ariaColumnCount =\n    ariaColumnCount != null ? ariaColumnCount : accessibilityColumnCount;\n  if (_ariaColumnCount != null) {\n    domProps['aria-colcount'] = _ariaColumnCount;\n  }\n\n  /*\n  if (accessibilityColumnIndex != null) {\n    warnOnce(\n      'accessibilityColumnIndex',\n      `accessibilityColumnIndex is deprecated. Use aria-colindex.`\n    );\n  }\n  */\n  const _ariaColumnIndex =\n    ariaColumnIndex != null ? ariaColumnIndex : accessibilityColumnIndex;\n  if (_ariaColumnIndex != null) {\n    domProps['aria-colindex'] = _ariaColumnIndex;\n  }\n\n  /*\n  if (accessibilityColumnSpan != null) {\n    warnOnce(\n      'accessibilityColumnSpan',\n      `accessibilityColumnSpan is deprecated. Use aria-colspan.`\n    );\n  }\n  */\n  const _ariaColumnSpan =\n    ariaColumnSpan != null ? ariaColumnSpan : accessibilityColumnSpan;\n  if (_ariaColumnSpan != null) {\n    domProps['aria-colspan'] = _ariaColumnSpan;\n  }\n\n  /*\n  if (accessibilityControls != null) {\n    warnOnce(\n      'accessibilityControls',\n      `accessibilityControls is deprecated. Use aria-controls.`\n    );\n  }\n  */\n  const _ariaControls =\n    ariaControls != null ? ariaControls : accessibilityControls;\n  if (_ariaControls != null) {\n    domProps['aria-controls'] = processIDRefList(_ariaControls);\n  }\n\n  /*\n  if (accessibilityCurrent != null) {\n    warnOnce(\n      'accessibilityCurrent',\n      `accessibilityCurrent is deprecated. Use aria-current.`\n    );\n  }\n  */\n  const _ariaCurrent = ariaCurrent != null ? ariaCurrent : accessibilityCurrent;\n  if (_ariaCurrent != null) {\n    domProps['aria-current'] = _ariaCurrent;\n  }\n\n  /*\n  if (accessibilityDescribedBy != null) {\n    warnOnce(\n      'accessibilityDescribedBy',\n      `accessibilityDescribedBy is deprecated. Use aria-describedby.`\n    );\n  }\n  */\n  const _ariaDescribedBy =\n    ariaDescribedBy != null ? ariaDescribedBy : accessibilityDescribedBy;\n  if (_ariaDescribedBy != null) {\n    domProps['aria-describedby'] = processIDRefList(_ariaDescribedBy);\n  }\n\n  /*\n  if (accessibilityDetails != null) {\n    warnOnce(\n      'accessibilityDetails',\n      `accessibilityDetails is deprecated. Use aria-details.`\n    );\n  }\n  */\n  const _ariaDetails = ariaDetails != null ? ariaDetails : accessibilityDetails;\n  if (_ariaDetails != null) {\n    domProps['aria-details'] = _ariaDetails;\n  }\n\n  if (disabled === true) {\n    domProps['aria-disabled'] = true;\n    // Enhance with native semantics\n    if (\n      elementType === 'button' ||\n      elementType === 'form' ||\n      elementType === 'input' ||\n      elementType === 'select' ||\n      elementType === 'textarea'\n    ) {\n      domProps.disabled = true;\n    }\n  }\n\n  /*\n  if (accessibilityErrorMessage != null) {\n    warnOnce(\n      'accessibilityErrorMessage',\n      `accessibilityErrorMessage is deprecated. Use aria-errormessage.`\n    );\n  }\n  */\n  const _ariaErrorMessage =\n    ariaErrorMessage != null ? ariaErrorMessage : accessibilityErrorMessage;\n  if (_ariaErrorMessage != null) {\n    domProps['aria-errormessage'] = _ariaErrorMessage;\n  }\n\n  /*\n  if (accessibilityExpanded != null) {\n    warnOnce(\n      'accessibilityExpanded',\n      `accessibilityExpanded is deprecated. Use aria-expanded.`\n    );\n  }\n  */\n  const _ariaExpanded =\n    ariaExpanded != null ? ariaExpanded : accessibilityExpanded;\n  if (_ariaExpanded != null) {\n    domProps['aria-expanded'] = _ariaExpanded;\n  }\n\n  /*\n  if (accessibilityFlowTo != null) {\n    warnOnce(\n      'accessibilityFlowTo',\n      `accessibilityFlowTo is deprecated. Use aria-flowto.`\n    );\n  }\n  */\n  const _ariaFlowTo = ariaFlowTo != null ? ariaFlowTo : accessibilityFlowTo;\n  if (_ariaFlowTo != null) {\n    domProps['aria-flowto'] = processIDRefList(_ariaFlowTo);\n  }\n\n  /*\n  if (accessibilityHasPopup != null) {\n    warnOnce(\n      'accessibilityHasPopup',\n      `accessibilityHasPopup is deprecated. Use aria-haspopup.`\n    );\n  }\n  */\n  const _ariaHasPopup =\n    ariaHasPopup != null ? ariaHasPopup : accessibilityHasPopup;\n  if (_ariaHasPopup != null) {\n    domProps['aria-haspopup'] = _ariaHasPopup;\n  }\n\n  /*\n  if (accessibilityHidden != null) {\n    warnOnce(\n      'accessibilityHidden',\n      `accessibilityHidden is deprecated. Use aria-hidden.`\n    );\n  }\n  */\n  const _ariaHidden = ariaHidden != null ? ariaHidden : accessibilityHidden;\n  if (_ariaHidden === true) {\n    domProps['aria-hidden'] = _ariaHidden;\n  }\n\n  /*\n  if (accessibilityInvalid != null) {\n    warnOnce(\n      'accessibilityInvalid',\n      `accessibilityInvalid is deprecated. Use aria-invalid.`\n    );\n  }\n  */\n  const _ariaInvalid = ariaInvalid != null ? ariaInvalid : accessibilityInvalid;\n  if (_ariaInvalid != null) {\n    domProps['aria-invalid'] = _ariaInvalid;\n  }\n\n  /*\n  if (accessibilityKeyShortcuts != null) {\n    warnOnce(\n      'accessibilityKeyShortcuts',\n      `accessibilityKeyShortcuts is deprecated. Use aria-keyshortcuts.`\n    );\n  }\n  */\n  const _ariaKeyShortcuts =\n    ariaKeyShortcuts != null ? ariaKeyShortcuts : accessibilityKeyShortcuts;\n  if (_ariaKeyShortcuts != null) {\n    domProps['aria-keyshortcuts'] = processIDRefList(_ariaKeyShortcuts);\n  }\n\n  /*\n  if (accessibilityLabel != null) {\n    warnOnce(\n      'accessibilityLabel',\n      `accessibilityLabel is deprecated. Use aria-label.`\n    );\n  }\n  */\n  const _ariaLabel = ariaLabel != null ? ariaLabel : accessibilityLabel;\n  if (_ariaLabel != null) {\n    domProps['aria-label'] = _ariaLabel;\n  }\n\n  /*\n  if (accessibilityLabelledBy != null) {\n    warnOnce(\n      'accessibilityLabelledBy',\n      `accessibilityLabelledBy is deprecated. Use aria-labelledby.`\n    );\n  }\n  */\n  const _ariaLabelledBy =\n    ariaLabelledBy != null ? ariaLabelledBy : accessibilityLabelledBy;\n  if (_ariaLabelledBy != null) {\n    domProps['aria-labelledby'] = processIDRefList(_ariaLabelledBy);\n  }\n\n  /*\n  if (accessibilityLevel != null) {\n    warnOnce(\n      'accessibilityLevel',\n      `accessibilityLevel is deprecated. Use aria-level.`\n    );\n  }\n  */\n  const _ariaLevel = ariaLevel != null ? ariaLevel : accessibilityLevel;\n  if (_ariaLevel != null) {\n    domProps['aria-level'] = _ariaLevel;\n  }\n\n  /*\n  if (accessibilityLiveRegion != null) {\n    warnOnce(\n      'accessibilityLiveRegion',\n      `accessibilityLiveRegion is deprecated. Use aria-live.`\n    );\n  }\n  */\n  const _ariaLive = ariaLive != null ? ariaLive : accessibilityLiveRegion;\n  if (_ariaLive != null) {\n    domProps['aria-live'] = _ariaLive === 'none' ? 'off' : _ariaLive;\n  }\n\n  /*\n  if (accessibilityModal != null) {\n    warnOnce(\n      'accessibilityModal',\n      `accessibilityModal is deprecated. Use aria-modal.`\n    );\n  }\n  */\n  const _ariaModal = ariaModal != null ? ariaModal : accessibilityModal;\n  if (_ariaModal != null) {\n    domProps['aria-modal'] = _ariaModal;\n  }\n\n  /*\n  if (accessibilityMultiline != null) {\n    warnOnce(\n      'accessibilityMultiline',\n      `accessibilityMultiline is deprecated. Use aria-multiline.`\n    );\n  }\n  */\n  const _ariaMultiline =\n    ariaMultiline != null ? ariaMultiline : accessibilityMultiline;\n  if (_ariaMultiline != null) {\n    domProps['aria-multiline'] = _ariaMultiline;\n  }\n\n  /*\n  if (accessibilityMultiSelectable != null) {\n    warnOnce(\n      'accessibilityMultiSelectable',\n      `accessibilityMultiSelectable is deprecated. Use aria-multiselectable.`\n    );\n  }\n  */\n  const _ariaMultiSelectable =\n    ariaMultiSelectable != null\n      ? ariaMultiSelectable\n      : accessibilityMultiSelectable;\n  if (_ariaMultiSelectable != null) {\n    domProps['aria-multiselectable'] = _ariaMultiSelectable;\n  }\n\n  /*\n  if (accessibilityOrientation != null) {\n    warnOnce(\n      'accessibilityOrientation',\n      `accessibilityOrientation is deprecated. Use aria-orientation.`\n    );\n  }\n  */\n  const _ariaOrientation =\n    ariaOrientation != null ? ariaOrientation : accessibilityOrientation;\n  if (_ariaOrientation != null) {\n    domProps['aria-orientation'] = _ariaOrientation;\n  }\n\n  /*\n  if (accessibilityOwns != null) {\n    warnOnce(\n      'accessibilityOwns',\n      `accessibilityOwns is deprecated. Use aria-owns.`\n    );\n  }\n  */\n  const _ariaOwns = ariaOwns != null ? ariaOwns : accessibilityOwns;\n  if (_ariaOwns != null) {\n    domProps['aria-owns'] = processIDRefList(_ariaOwns);\n  }\n\n  /*\n  if (accessibilityPlaceholder != null) {\n    warnOnce(\n      'accessibilityPlaceholder',\n      `accessibilityPlaceholder is deprecated. Use aria-placeholder.`\n    );\n  }\n  */\n  const _ariaPlaceholder =\n    ariaPlaceholder != null ? ariaPlaceholder : accessibilityPlaceholder;\n  if (_ariaPlaceholder != null) {\n    domProps['aria-placeholder'] = _ariaPlaceholder;\n  }\n\n  /*\n  if (accessibilityPosInSet != null) {\n    warnOnce(\n      'accessibilityPosInSet',\n      `accessibilityPosInSet is deprecated. Use aria-posinset.`\n    );\n  }\n  */\n  const _ariaPosInSet =\n    ariaPosInSet != null ? ariaPosInSet : accessibilityPosInSet;\n  if (_ariaPosInSet != null) {\n    domProps['aria-posinset'] = _ariaPosInSet;\n  }\n\n  /*\n  if (accessibilityPressed != null) {\n    warnOnce(\n      'accessibilityPressed',\n      `accessibilityPressed is deprecated. Use aria-pressed.`\n    );\n  }\n  */\n  const _ariaPressed = ariaPressed != null ? ariaPressed : accessibilityPressed;\n  if (_ariaPressed != null) {\n    domProps['aria-pressed'] = _ariaPressed;\n  }\n\n  /*\n  if (accessibilityReadOnly != null) {\n    warnOnce(\n      'accessibilityReadOnly',\n      `accessibilityReadOnly is deprecated. Use aria-readonly.`\n    );\n  }\n  */\n  const _ariaReadOnly =\n    ariaReadOnly != null ? ariaReadOnly : accessibilityReadOnly;\n  if (_ariaReadOnly != null) {\n    domProps['aria-readonly'] = _ariaReadOnly;\n    // Enhance with native semantics\n    if (\n      elementType === 'input' ||\n      elementType === 'select' ||\n      elementType === 'textarea'\n    ) {\n      domProps.readOnly = true;\n    }\n  }\n\n  /*\n  if (accessibilityRequired != null) {\n    warnOnce(\n      'accessibilityRequired',\n      `accessibilityRequired is deprecated. Use aria-required.`\n    );\n  }\n  */\n  const _ariaRequired =\n    ariaRequired != null ? ariaRequired : accessibilityRequired;\n  if (_ariaRequired != null) {\n    domProps['aria-required'] = _ariaRequired;\n    // Enhance with native semantics\n    if (\n      elementType === 'input' ||\n      elementType === 'select' ||\n      elementType === 'textarea'\n    ) {\n      domProps.required = accessibilityRequired;\n    }\n  }\n\n  /*\n  if (accessibilityRole != null) {\n    warnOnce('accessibilityRole', `accessibilityRole is deprecated. Use role.`);\n  }\n  */\n  if (role != null) {\n    // 'presentation' synonym has wider browser support\n    domProps['role'] = role === 'none' ? 'presentation' : role;\n  }\n\n  /*\n  if (accessibilityRoleDescription != null) {\n    warnOnce(\n      'accessibilityRoleDescription',\n      `accessibilityRoleDescription is deprecated. Use aria-roledescription.`\n    );\n  }\n  */\n  const _ariaRoleDescription =\n    ariaRoleDescription != null\n      ? ariaRoleDescription\n      : accessibilityRoleDescription;\n  if (_ariaRoleDescription != null) {\n    domProps['aria-roledescription'] = _ariaRoleDescription;\n  }\n\n  /*\n  if (accessibilityRowCount != null) {\n    warnOnce(\n      'accessibilityRowCount',\n      `accessibilityRowCount is deprecated. Use aria-rowcount.`\n    );\n  }\n  */\n  const _ariaRowCount =\n    ariaRowCount != null ? ariaRowCount : accessibilityRowCount;\n  if (_ariaRowCount != null) {\n    domProps['aria-rowcount'] = _ariaRowCount;\n  }\n\n  /*\n  if (accessibilityRowIndex != null) {\n    warnOnce(\n      'accessibilityRowIndex',\n      `accessibilityRowIndex is deprecated. Use aria-rowindex.`\n    );\n  }\n  */\n  const _ariaRowIndex =\n    ariaRowIndex != null ? ariaRowIndex : accessibilityRowIndex;\n  if (_ariaRowIndex != null) {\n    domProps['aria-rowindex'] = _ariaRowIndex;\n  }\n\n  /*\n  if (accessibilityRowSpan != null) {\n    warnOnce(\n      'accessibilityRowSpan',\n      `accessibilityRowSpan is deprecated. Use aria-rowspan.`\n    );\n  }\n  */\n  const _ariaRowSpan = ariaRowSpan != null ? ariaRowSpan : accessibilityRowSpan;\n  if (_ariaRowSpan != null) {\n    domProps['aria-rowspan'] = _ariaRowSpan;\n  }\n\n  /*\n  if (accessibilitySelected != null) {\n    warnOnce(\n      'accessibilitySelected',\n      `accessibilitySelected is deprecated. Use aria-selected.`\n    );\n  }\n  */\n  const _ariaSelected =\n    ariaSelected != null ? ariaSelected : accessibilitySelected;\n  if (_ariaSelected != null) {\n    domProps['aria-selected'] = _ariaSelected;\n  }\n\n  /*\n  if (accessibilitySetSize != null) {\n    warnOnce(\n      'accessibilitySetSize',\n      `accessibilitySetSize is deprecated. Use aria-setsize.`\n    );\n  }\n  */\n  const _ariaSetSize = ariaSetSize != null ? ariaSetSize : accessibilitySetSize;\n  if (_ariaSetSize != null) {\n    domProps['aria-setsize'] = _ariaSetSize;\n  }\n\n  /*\n  if (accessibilitySort != null) {\n    warnOnce(\n      'accessibilitySort',\n      `accessibilitySort is deprecated. Use aria-sort.`\n    );\n  }\n  */\n  const _ariaSort = ariaSort != null ? ariaSort : accessibilitySort;\n  if (_ariaSort != null) {\n    domProps['aria-sort'] = _ariaSort;\n  }\n\n  /*\n  if (accessibilityValueMax != null) {\n    warnOnce(\n      'accessibilityValueMax',\n      `accessibilityValueMax is deprecated. Use aria-valuemax.`\n    );\n  }\n  */\n  const _ariaValueMax =\n    ariaValueMax != null ? ariaValueMax : accessibilityValueMax;\n  if (_ariaValueMax != null) {\n    domProps['aria-valuemax'] = _ariaValueMax;\n  }\n\n  /*\n  if (accessibilityValueMin != null) {\n    warnOnce(\n      'accessibilityValueMin',\n      `accessibilityValueMin is deprecated. Use aria-valuemin.`\n    );\n  }\n  */\n  const _ariaValueMin =\n    ariaValueMin != null ? ariaValueMin : accessibilityValueMin;\n  if (_ariaValueMin != null) {\n    domProps['aria-valuemin'] = _ariaValueMin;\n  }\n\n  /*\n  if (accessibilityValueNow != null) {\n    warnOnce(\n      'accessibilityValueNow',\n      `accessibilityValueNow is deprecated. Use aria-valuenow.`\n    );\n  }\n  */\n  const _ariaValueNow =\n    ariaValueNow != null ? ariaValueNow : accessibilityValueNow;\n  if (_ariaValueNow != null) {\n    domProps['aria-valuenow'] = _ariaValueNow;\n  }\n\n  /*\n  if (accessibilityValueText != null) {\n    warnOnce(\n      'accessibilityValueText',\n      `accessibilityValueText is deprecated. Use aria-valuetext.`\n    );\n  }\n  */\n  const _ariaValueText =\n    ariaValueText != null ? ariaValueText : accessibilityValueText;\n  if (_ariaValueText != null) {\n    domProps['aria-valuetext'] = _ariaValueText;\n  }\n\n  // \"dataSet\" replaced with \"data-*\"\n  if (dataSet != null) {\n    for (const dataProp in dataSet) {\n      if (hasOwnProperty.call(dataSet, dataProp)) {\n        const dataName = hyphenateString(dataProp);\n        const dataValue = dataSet[dataProp];\n        if (dataValue != null) {\n          domProps[`data-${dataName}`] = dataValue;\n        }\n      }\n    }\n  }\n\n  // FOCUS\n  if (\n    tabIndex === 0 ||\n    tabIndex === '0' ||\n    tabIndex === -1 ||\n    tabIndex === '-1'\n  ) {\n    domProps.tabIndex = tabIndex;\n  } else {\n    /*\n    if (focusable != null) {\n      warnOnce('focusable', `focusable is deprecated.`);\n    }\n    */\n\n    // \"focusable\" indicates that an element may be a keyboard tab-stop.\n    if (focusable === false) {\n      domProps.tabIndex = '-1';\n    }\n    if (\n      // These native elements are keyboard focusable by default\n      elementType === 'a' ||\n      elementType === 'button' ||\n      elementType === 'input' ||\n      elementType === 'select' ||\n      elementType === 'textarea'\n    ) {\n      if (focusable === false || accessibilityDisabled === true) {\n        domProps.tabIndex = '-1';\n      }\n    } else if (\n      // These roles are made keyboard focusable by default\n      role === 'button' ||\n      role === 'checkbox' ||\n      role === 'link' ||\n      role === 'radio' ||\n      role === 'textbox' ||\n      role === 'switch'\n    ) {\n      if (focusable !== false) {\n        domProps.tabIndex = '0';\n      }\n    } else {\n      // Everything else must explicitly set the prop\n      if (focusable === true) {\n        domProps.tabIndex = '0';\n      }\n    }\n  }\n\n  // Resolve styles\n  if (pointerEvents != null) {\n    warnOnce(\n      'pointerEvents',\n      `props.pointerEvents is deprecated. Use style.pointerEvents`\n    );\n  }\n\n  const [className, inlineStyle] = StyleSheet(\n    [style, pointerEvents && pointerEventsStyles[pointerEvents]],\n    {\n      writingDirection: 'ltr',\n      ...options\n    }\n  );\n  if (className) {\n    domProps.className = className;\n  }\n  if (inlineStyle) {\n    domProps.style = inlineStyle;\n  }\n\n  // OTHER\n  // Native element ID\n  /*\n  if (nativeID != null) {\n    warnOnce('nativeID', `nativeID is deprecated. Use id.`);\n  }\n  */\n  const _id = id != null ? id : nativeID;\n  if (_id != null) {\n    domProps.id = _id;\n  }\n  // Automated test IDs\n  if (testID != null) {\n    domProps['data-testid'] = testID;\n  }\n\n  if (domProps.type == null && elementType === 'button') {\n    domProps.type = 'button';\n  }\n  return domProps;\n};\n\nexport default createDOMProps;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/dismissKeyboard/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nimport TextInputState from '../TextInputState';\n\nconst dismissKeyboard = () => {\n  TextInputState.blurTextInput(TextInputState.currentlyFocusedField());\n};\n\nexport default dismissKeyboard;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/forwardedProps/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n */\n\nexport const defaultProps = {\n  children: true,\n  dataSet: true,\n  dir: true,\n  id: true,\n  ref: true,\n  suppressHydrationWarning: true,\n  tabIndex: true,\n  testID: true,\n  // @deprecated\n  focusable: true,\n  nativeID: true\n};\n\nexport const accessibilityProps = {\n  'aria-activedescendant': true,\n  'aria-atomic': true,\n  'aria-autocomplete': true,\n  'aria-busy': true,\n  'aria-checked': true,\n  'aria-colcount': true,\n  'aria-colindex': true,\n  'aria-colspan': true,\n  'aria-controls': true,\n  'aria-current': true,\n  'aria-describedby': true,\n  'aria-details': true,\n  'aria-disabled': true,\n  'aria-errormessage': true,\n  'aria-expanded': true,\n  'aria-flowto': true,\n  'aria-haspopup': true,\n  'aria-hidden': true,\n  'aria-invalid': true,\n  'aria-keyshortcuts': true,\n  'aria-label': true,\n  'aria-labelledby': true,\n  'aria-level': true,\n  'aria-live': true,\n  'aria-modal': true,\n  'aria-multiline': true,\n  'aria-multiselectable': true,\n  'aria-orientation': true,\n  'aria-owns': true,\n  'aria-placeholder': true,\n  'aria-posinset': true,\n  'aria-pressed': true,\n  'aria-readonly': true,\n  'aria-required': true,\n  inert: true,\n  role: true,\n  'aria-roledescription': true,\n  'aria-rowcount': true,\n  'aria-rowindex': true,\n  'aria-rowspan': true,\n  'aria-selected': true,\n  'aria-setsize': true,\n  'aria-sort': true,\n  'aria-valuemax': true,\n  'aria-valuemin': true,\n  'aria-valuenow': true,\n  'aria-valuetext': true,\n  // @deprecated\n  accessibilityActiveDescendant: true,\n  accessibilityAtomic: true,\n  accessibilityAutoComplete: true,\n  accessibilityBusy: true,\n  accessibilityChecked: true,\n  accessibilityColumnCount: true,\n  accessibilityColumnIndex: true,\n  accessibilityColumnSpan: true,\n  accessibilityControls: true,\n  accessibilityCurrent: true,\n  accessibilityDescribedBy: true,\n  accessibilityDetails: true,\n  accessibilityDisabled: true,\n  accessibilityErrorMessage: true,\n  accessibilityExpanded: true,\n  accessibilityFlowTo: true,\n  accessibilityHasPopup: true,\n  accessibilityHidden: true,\n  accessibilityInvalid: true,\n  accessibilityKeyShortcuts: true,\n  accessibilityLabel: true,\n  accessibilityLabelledBy: true,\n  accessibilityLevel: true,\n  accessibilityLiveRegion: true,\n  accessibilityModal: true,\n  accessibilityMultiline: true,\n  accessibilityMultiSelectable: true,\n  accessibilityOrientation: true,\n  accessibilityOwns: true,\n  accessibilityPlaceholder: true,\n  accessibilityPosInSet: true,\n  accessibilityPressed: true,\n  accessibilityReadOnly: true,\n  accessibilityRequired: true,\n  accessibilityRole: true,\n  accessibilityRoleDescription: true,\n  accessibilityRowCount: true,\n  accessibilityRowIndex: true,\n  accessibilityRowSpan: true,\n  accessibilitySelected: true,\n  accessibilitySetSize: true,\n  accessibilitySort: true,\n  accessibilityValueMax: true,\n  accessibilityValueMin: true,\n  accessibilityValueNow: true,\n  accessibilityValueText: true\n};\n\nexport const clickProps = {\n  onClick: true,\n  onAuxClick: true,\n  onContextMenu: true,\n  onGotPointerCapture: true,\n  onLostPointerCapture: true,\n  onPointerCancel: true,\n  onPointerDown: true,\n  onPointerEnter: true,\n  onPointerMove: true,\n  onPointerLeave: true,\n  onPointerOut: true,\n  onPointerOver: true,\n  onPointerUp: true\n};\n\nexport const focusProps = {\n  onBlur: true,\n  onFocus: true\n};\n\nexport const keyboardProps = {\n  onKeyDown: true,\n  onKeyDownCapture: true,\n  onKeyUp: true,\n  onKeyUpCapture: true\n};\n\nexport const mouseProps = {\n  onMouseDown: true,\n  onMouseEnter: true,\n  onMouseLeave: true,\n  onMouseMove: true,\n  onMouseOver: true,\n  onMouseOut: true,\n  onMouseUp: true\n};\n\nexport const touchProps = {\n  onTouchCancel: true,\n  onTouchCancelCapture: true,\n  onTouchEnd: true,\n  onTouchEndCapture: true,\n  onTouchMove: true,\n  onTouchMoveCapture: true,\n  onTouchStart: true,\n  onTouchStartCapture: true\n};\n\nexport const styleProps = {\n  style: true\n};\n"
  },
  {
    "path": "packages/react-native-web/src/modules/getBoundingClientRect/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow strict\n */\n\nconst getBoundingClientRect = (node: ?HTMLElement): void | ClientRect => {\n  if (node != null) {\n    const isElement = node.nodeType === 1; /* Node.ELEMENT_NODE */\n    if (isElement && typeof node.getBoundingClientRect === 'function') {\n      return node.getBoundingClientRect();\n    }\n  }\n};\n\nexport default getBoundingClientRect;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/isSelectionValid/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher\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 * @flow\n */\n\nexport default function isSelectionValid(): boolean {\n  const selection = window.getSelection();\n  const string = selection.toString();\n  const anchorNode = selection.anchorNode;\n  const focusNode = selection.focusNode;\n  const isTextNode =\n    (anchorNode && anchorNode.nodeType === window.Node.TEXT_NODE) ||\n    (focusNode && focusNode.nodeType === window.Node.TEXT_NODE);\n  return string.length >= 1 && string !== '\\n' && isTextNode;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/isWebColor/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nconst isWebColor = (color: string): boolean =>\n  color === 'currentcolor' ||\n  color === 'currentColor' ||\n  color === 'inherit' ||\n  color.indexOf('var(') === 0;\n\nexport default isWebColor;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/mergeRefs/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport * as React from 'react';\nimport mergeRefs from '..';\nimport { render } from '@testing-library/react';\n\ndescribe('modules/mergeRefs', () => {\n  test('merges refs of different types', () => {\n    const ref = React.createRef(null);\n    let functionRefValue = null;\n    let hookRef;\n    function Component() {\n      const functionRef = (x) => {\n        functionRefValue = x;\n      };\n      hookRef = React.useRef(null);\n      return <div ref={mergeRefs(ref, hookRef, functionRef)} />;\n    }\n\n    render(<Component />);\n\n    expect(ref.current).toBeInstanceOf(HTMLDivElement);\n    expect(hookRef.current).toBeInstanceOf(HTMLDivElement);\n    expect(functionRefValue).toBeInstanceOf(HTMLDivElement);\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/modules/mergeRefs/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict\n */\n\nimport * as React from 'react';\n\nexport default function mergeRefs(\n  ...args: $ReadOnlyArray<React.ElementRef<any>>\n): (node: HTMLElement | null) => void {\n  return function forwardRef(node: HTMLElement | null) {\n    args.forEach((ref: React.ElementRef<any>) => {\n      if (ref == null) {\n        return;\n      }\n      if (typeof ref === 'function') {\n        ref(node);\n        return;\n      }\n      if (typeof ref === 'object') {\n        ref.current = node;\n        return;\n      }\n      console.error(\n        `mergeRefs cannot handle Refs of type boolean, number or string, received ref ${String(\n          ref\n        )}`\n      );\n    });\n  };\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/modality/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport {\n  getModality,\n  getActiveModality,\n  testOnly_resetActiveModality\n} from '..';\nimport {\n  describeWithPointerEvent,\n  testWithPointerType,\n  clearPointers,\n  createEventTarget,\n  setPointerEvent\n} from 'dom-event-testing-library';\n\ndescribeWithPointerEvent('modules/modality', (hasPointerEvent) => {\n  let rootNode;\n\n  beforeEach(() => {\n    setPointerEvent(hasPointerEvent);\n    rootNode = document.createElement('div');\n    document.body.appendChild(rootNode);\n  });\n\n  afterEach(() => {\n    document.body.removeChild(rootNode);\n    rootNode = null;\n    clearPointers();\n    testOnly_resetActiveModality();\n  });\n\n  describe('getModality', () => {\n    testWithPointerType('reflects currently-in-use modality', (pointerType) => {\n      const target = createEventTarget(rootNode);\n      expect(getModality()).toBe('keyboard');\n      target.pointerdown({ pointerType });\n      expect(getModality()).toBe(pointerType);\n      target.pointerup({ pointerType });\n      target.keydown();\n      expect(getModality()).toBe('keyboard');\n      if (pointerType !== 'touch') {\n        target.pointermove({ pointerType });\n        expect(getModality()).toBe(pointerType);\n        target.keydown();\n        expect(getModality()).toBe('keyboard');\n      }\n    });\n  });\n\n  describe('getActiveModality', () => {\n    testWithPointerType(\n      'reflects last actively used modality',\n      (pointerType) => {\n        const target = createEventTarget(rootNode);\n        expect(getActiveModality()).toBe('keyboard');\n        target.pointerdown({ pointerType });\n        expect(getActiveModality()).toBe(pointerType);\n        target.pointerup({ pointerType });\n        target.keydown();\n        if (pointerType !== 'touch') {\n          target.pointermove({ pointerType });\n          expect(getActiveModality()).toBe('keyboard');\n        }\n      }\n    );\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/modules/modality/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nimport { addEventListener } from '../addEventListener';\nimport canUseDOM from '../canUseDom';\n\nexport type Modality = 'keyboard' | 'mouse' | 'touch' | 'pen';\n\nconst supportsPointerEvent = () =>\n  !!(typeof window !== 'undefined' && window.PointerEvent != null);\n\nlet activeModality = 'keyboard';\nlet modality = 'keyboard';\nlet previousModality;\nlet previousActiveModality;\nlet isEmulatingMouseEvents = false;\nconst listeners = new Set();\n\nconst KEYBOARD = 'keyboard';\nconst MOUSE = 'mouse';\nconst TOUCH = 'touch';\n\nconst BLUR = 'blur';\nconst CONTEXTMENU = 'contextmenu';\nconst FOCUS = 'focus';\nconst KEYDOWN = 'keydown';\nconst MOUSEDOWN = 'mousedown';\nconst MOUSEMOVE = 'mousemove';\nconst MOUSEUP = 'mouseup';\nconst POINTERDOWN = 'pointerdown';\nconst POINTERMOVE = 'pointermove';\nconst SCROLL = 'scroll';\nconst SELECTIONCHANGE = 'selectionchange';\nconst TOUCHCANCEL = 'touchcancel';\nconst TOUCHMOVE = 'touchmove';\nconst TOUCHSTART = 'touchstart';\nconst VISIBILITYCHANGE = 'visibilitychange';\n\nconst bubbleOptions = { passive: true };\nconst captureOptions = { capture: true, passive: true };\n\nfunction restoreModality() {\n  if (previousModality != null || previousActiveModality != null) {\n    if (previousModality != null) {\n      modality = previousModality;\n      previousModality = null;\n    }\n    if (previousActiveModality != null) {\n      activeModality = previousActiveModality;\n      previousActiveModality = null;\n    }\n    callListeners();\n  }\n}\n\nfunction onBlurWindow() {\n  previousModality = modality;\n  previousActiveModality = activeModality;\n  activeModality = KEYBOARD;\n  modality = KEYBOARD;\n  callListeners();\n  // for fallback events\n  isEmulatingMouseEvents = false;\n}\n\nfunction onFocusWindow() {\n  restoreModality();\n}\n\nfunction onKeyDown(event) {\n  if (event.metaKey || event.altKey || event.ctrlKey) {\n    return;\n  }\n  if (modality !== KEYBOARD) {\n    modality = KEYBOARD;\n    activeModality = KEYBOARD;\n    callListeners();\n  }\n}\n\nfunction onVisibilityChange() {\n  if (document.visibilityState !== 'hidden') {\n    restoreModality();\n  }\n}\n\nfunction onPointerish(event: any) {\n  const eventType = event.type;\n\n  if (supportsPointerEvent()) {\n    if (eventType === POINTERDOWN) {\n      if (activeModality !== event.pointerType) {\n        modality = event.pointerType;\n        activeModality = event.pointerType;\n        callListeners();\n      }\n      return;\n    }\n    if (eventType === POINTERMOVE) {\n      if (modality !== event.pointerType) {\n        modality = event.pointerType;\n        callListeners();\n      }\n      return;\n    }\n  }\n  // Fallback for non-PointerEvent environment\n  else {\n    if (!isEmulatingMouseEvents) {\n      if (eventType === MOUSEDOWN) {\n        if (activeModality !== MOUSE) {\n          modality = MOUSE;\n          activeModality = MOUSE;\n          callListeners();\n        }\n      }\n      if (eventType === MOUSEMOVE) {\n        if (modality !== MOUSE) {\n          modality = MOUSE;\n          callListeners();\n        }\n      }\n    }\n\n    // Flag when browser may produce emulated events\n    if (eventType === TOUCHSTART) {\n      isEmulatingMouseEvents = true;\n      if (event.touches && event.touches.length > 1) {\n        isEmulatingMouseEvents = false;\n      }\n      if (activeModality !== TOUCH) {\n        modality = TOUCH;\n        activeModality = TOUCH;\n        callListeners();\n      }\n      return;\n    }\n\n    // Remove flag after emulated events are finished or cancelled, and if an\n    // event occurs that cuts short a touch event sequence.\n    if (\n      eventType === CONTEXTMENU ||\n      eventType === MOUSEUP ||\n      eventType === SELECTIONCHANGE ||\n      eventType === SCROLL ||\n      eventType === TOUCHCANCEL ||\n      eventType === TOUCHMOVE\n    ) {\n      isEmulatingMouseEvents = false;\n    }\n  }\n}\n\nif (canUseDOM) {\n  // Window events\n  addEventListener(window, BLUR, onBlurWindow, bubbleOptions);\n  addEventListener(window, FOCUS, onFocusWindow, bubbleOptions);\n  // Must be capture phase because 'stopPropagation' might prevent these\n  // events bubbling to the document.\n  addEventListener(document, KEYDOWN, onKeyDown, captureOptions);\n  addEventListener(\n    document,\n    VISIBILITYCHANGE,\n    onVisibilityChange,\n    captureOptions\n  );\n  addEventListener(document, POINTERDOWN, onPointerish, captureOptions);\n  addEventListener(document, POINTERMOVE, onPointerish, captureOptions);\n  // Fallback events\n  addEventListener(document, CONTEXTMENU, onPointerish, captureOptions);\n  addEventListener(document, MOUSEDOWN, onPointerish, captureOptions);\n  addEventListener(document, MOUSEMOVE, onPointerish, captureOptions);\n  addEventListener(document, MOUSEUP, onPointerish, captureOptions);\n  addEventListener(document, TOUCHCANCEL, onPointerish, captureOptions);\n  addEventListener(document, TOUCHMOVE, onPointerish, captureOptions);\n  addEventListener(document, TOUCHSTART, onPointerish, captureOptions);\n  addEventListener(document, SELECTIONCHANGE, onPointerish, captureOptions);\n  addEventListener(document, SCROLL, onPointerish, captureOptions);\n}\n\nfunction callListeners() {\n  const value = { activeModality, modality };\n  listeners.forEach((listener) => {\n    listener(value);\n  });\n}\n\nexport function getActiveModality(): Modality {\n  return activeModality;\n}\n\nexport function getModality(): Modality {\n  return modality;\n}\n\nexport function addModalityListener(\n  listener: ({ activeModality: Modality, modality: Modality }) => void\n): () => void {\n  listeners.add(listener);\n  return () => {\n    listeners.delete(listener);\n  };\n}\n\nexport function testOnly_resetActiveModality() {\n  isEmulatingMouseEvents = false;\n  activeModality = KEYBOARD;\n  modality = KEYBOARD;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/multiplyStyleLengthValue/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport multiplyStyleLengthValue from '..';\n\ndescribe('modules/multiplyStyleLengthValue', () => {\n  test('number', () => {\n    expect(multiplyStyleLengthValue(2, -1)).toEqual(-2);\n    expect(multiplyStyleLengthValue(2, 2)).toEqual(4);\n    expect(multiplyStyleLengthValue(2.5, 2)).toEqual(5);\n  });\n\n  test('length', () => {\n    expect(multiplyStyleLengthValue('2rem', -1)).toEqual('-2rem');\n    expect(multiplyStyleLengthValue('2px', 2)).toEqual('4px');\n    expect(multiplyStyleLengthValue('2.5em', 2)).toEqual('5em');\n    expect(multiplyStyleLengthValue('2e3px', 2)).toEqual('4000px');\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/modules/multiplyStyleLengthValue/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @noflow\n */\n\nconst CSS_UNIT_RE = /^[+-]?\\d*(?:\\.\\d+)?(?:[Ee][+-]?\\d+)?(%|\\w*)/;\n\nconst getUnit = (str) => str.match(CSS_UNIT_RE)[1];\n\nconst isNumeric = (n) => {\n  return !isNaN(parseFloat(n)) && isFinite(n);\n};\n\nconst multiplyStyleLengthValue = (value: string | number, multiple) => {\n  if (typeof value === 'string') {\n    const number = parseFloat(value) * multiple;\n    const unit = getUnit(value);\n    return `${number}${unit}`;\n  } else if (isNumeric(value)) {\n    return value * multiple;\n  }\n};\n\nexport default multiplyStyleLengthValue;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/normalizeColor/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nimport isWebColor from '../isWebColor';\nimport processColor from '../../exports/processColor';\n\nconst normalizeColor = (\n  color?: number | string,\n  opacity?: number = 1\n): void | string => {\n  if (color == null) return;\n\n  if (typeof color === 'string' && isWebColor(color)) {\n    return color;\n  }\n\n  const colorInt = processColor(color);\n  if (colorInt != null) {\n    const r = (colorInt >> 16) & 255;\n    const g = (colorInt >> 8) & 255;\n    const b = colorInt & 255;\n    const a = ((colorInt >> 24) & 255) / 255;\n    const alpha = (a * opacity).toFixed(2);\n    return `rgba(${r},${g},${b},${alpha})`;\n  }\n};\n\nexport default normalizeColor;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/pick/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nexport default function pick(obj: Object, list: { [string]: boolean }): Object {\n  const nextObj = {};\n  for (const key in obj) {\n    if (obj.hasOwnProperty(key)) {\n      if (list[key] === true) {\n        nextObj[key] = obj[key];\n      }\n    }\n  }\n  return nextObj;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/prefixStyles/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nimport createPrefixer from 'inline-style-prefixer/lib/createPrefixer';\nimport staticData from './static';\n\ntype StyleModifier = (style: Object) => Object;\n\nconst prefixAll: StyleModifier = createPrefixer(staticData);\n\nexport default prefixAll;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/prefixStyles/static.js",
    "content": "import crossFade from 'inline-style-prefixer/lib/plugins/crossFade';\nimport imageSet from 'inline-style-prefixer/lib/plugins/imageSet';\nimport logical from 'inline-style-prefixer/lib/plugins/logical';\nimport position from 'inline-style-prefixer/lib/plugins/position';\nimport sizing from 'inline-style-prefixer/lib/plugins/sizing';\nimport transition from 'inline-style-prefixer/lib/plugins/transition';\nconst w = ['Webkit'];\nconst m = ['Moz'];\nconst wm = ['Webkit', 'Moz'];\nconst wms = ['Webkit', 'ms'];\nconst wmms = ['Webkit', 'Moz', 'ms'];\n\nexport default {\n  plugins: [crossFade, imageSet, logical, position, sizing, transition],\n  prefixMap: {\n    appearance: wmms,\n    userSelect: wm,\n    textEmphasisPosition: wms,\n    textEmphasis: wms,\n    textEmphasisStyle: wms,\n    textEmphasisColor: wms,\n    boxDecorationBreak: wms,\n    clipPath: w,\n    maskImage: wms,\n    maskMode: wms,\n    maskRepeat: wms,\n    maskPosition: wms,\n    maskClip: wms,\n    maskOrigin: wms,\n    maskSize: wms,\n    maskComposite: wms,\n    mask: wms,\n    maskBorderSource: wms,\n    maskBorderMode: wms,\n    maskBorderSlice: wms,\n    maskBorderWidth: wms,\n    maskBorderOutset: wms,\n    maskBorderRepeat: wms,\n    maskBorder: wms,\n    maskType: wms,\n    textDecorationStyle: w,\n    textDecorationSkip: w,\n    textDecorationLine: w,\n    textDecorationColor: w,\n    filter: w,\n    breakAfter: w,\n    breakBefore: w,\n    breakInside: w,\n    columnCount: w,\n    columnFill: w,\n    columnGap: w,\n    columnRule: w,\n    columnRuleColor: w,\n    columnRuleStyle: w,\n    columnRuleWidth: w,\n    columns: w,\n    columnSpan: w,\n    columnWidth: w,\n    backdropFilter: w,\n    hyphens: w,\n    flowInto: w,\n    flowFrom: w,\n    regionFragment: w,\n    textOrientation: w,\n    tabSize: m,\n    fontKerning: w,\n    textSizeAdjust: w\n  }\n};\n"
  },
  {
    "path": "packages/react-native-web/src/modules/requestIdleCallback/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\nimport canUseDOM from '../canUseDom';\n\nconst _requestIdleCallback = function (cb: Function, options?: Object) {\n  return setTimeout(() => {\n    const start = Date.now();\n    cb({\n      didTimeout: false,\n      timeRemaining() {\n        return Math.max(0, 50 - (Date.now() - start));\n      }\n    });\n  }, 1);\n};\n\nconst _cancelIdleCallback = function (id) {\n  clearTimeout(id);\n};\n\nconst isSupported =\n  canUseDOM && typeof window.requestIdleCallback !== 'undefined';\n\nconst requestIdleCallback: (cb: any, options?: any) => TimeoutID = isSupported\n  ? window.requestIdleCallback\n  : _requestIdleCallback;\nconst cancelIdleCallback: (TimeoutID) => void = isSupported\n  ? window.cancelIdleCallback\n  : _cancelIdleCallback;\n\nexport default requestIdleCallback;\nexport { cancelIdleCallback };\n"
  },
  {
    "path": "packages/react-native-web/src/modules/setValueForStyles/dangerousStyleValue.js",
    "content": "/* eslint-disable */\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * From React 16.0.0\n * @noflow\n */\n\nimport isUnitlessNumber from '../unitlessNumbers';\n\n/**\n * Convert a value into the proper css writable value. The style name `name`\n * should be logical (no hyphens), as specified\n * in `CSSProperty.isUnitlessNumber`.\n *\n * @param {string} name CSS property name such as `topMargin`.\n * @param {*} value CSS property value such as `10px`.\n * @return {string} Normalized style value with dimensions applied.\n */\nfunction dangerousStyleValue(name, value, isCustomProperty) {\n  // Note that we've removed escapeTextForBrowser() calls here since the\n  // whole string will be escaped when the attribute is injected into\n  // the markup. If you provide unsafe user data here they can inject\n  // arbitrary CSS which may be problematic (I couldn't repro this):\n  // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet\n  // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/\n  // This is not an XSS hole but instead a potential CSS injection issue\n  // which has lead to a greater discussion about how we're going to\n  // trust URLs moving forward. See #2115901\n\n  var isEmpty = value == null || typeof value === 'boolean' || value === '';\n  if (isEmpty) {\n    return '';\n  }\n\n  if (\n    !isCustomProperty &&\n    typeof value === 'number' &&\n    value !== 0 &&\n    !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])\n  ) {\n    return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers\n  }\n\n  return ('' + value).trim();\n}\n\nexport default dangerousStyleValue;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/setValueForStyles/index.js",
    "content": "/* eslint-disable */\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * From React 16.3.0\n * @noflow\n */\n\nimport dangerousStyleValue from './dangerousStyleValue';\n\n/**\n * Sets the value for multiple styles on a node.  If a value is specified as\n * '' (empty string), the corresponding style property will be unset.\n *\n * @param {DOMElement} node\n * @param {object} styles\n */\nfunction setValueForStyles(node, styles) {\n  const style = node.style;\n  for (let styleName in styles) {\n    if (!styles.hasOwnProperty(styleName)) {\n      continue;\n    }\n    const isCustomProperty = styleName.indexOf('--') === 0;\n    const styleValue = dangerousStyleValue(\n      styleName,\n      styles[styleName],\n      isCustomProperty\n    );\n    if (styleName === 'float') {\n      styleName = 'cssFloat';\n    }\n    if (isCustomProperty) {\n      style.setProperty(styleName, styleValue);\n    } else {\n      style[styleName] = styleValue;\n    }\n  }\n}\n\nexport default setValueForStyles;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/unitlessNumbers/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nconst unitlessNumbers = {\n  animationIterationCount: true,\n  aspectRatio: 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  flexOrder: true,\n  flexPositive: true,\n  flexShrink: true,\n  flexNegative: true,\n  fontWeight: true,\n  gridRow: true,\n  gridRowEnd: true,\n  gridRowGap: true,\n  gridRowStart: true,\n  gridColumn: true,\n  gridColumnEnd: true,\n  gridColumnGap: true,\n  gridColumnStart: true,\n  lineClamp: true,\n  opacity: true,\n  order: true,\n  orphans: true,\n  tabSize: true,\n  widows: true,\n  zIndex: true,\n  zoom: true,\n  // SVG-related\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  // transform types\n  scale: true,\n  scaleX: true,\n  scaleY: true,\n  scaleZ: true,\n  // RN properties\n  shadowOpacity: true\n};\n\n/**\n * Support style names that may come passed in prefixed by adding permutations\n * of vendor prefixes.\n */\nconst prefixes = ['ms', 'Moz', 'O', 'Webkit'];\nconst prefixKey = (prefix: string, key: string) => {\n  return prefix + key.charAt(0).toUpperCase() + key.substring(1);\n};\nObject.keys(unitlessNumbers).forEach((prop) => {\n  prefixes.forEach((prefix) => {\n    unitlessNumbers[prefixKey(prefix, prop)] = unitlessNumbers[prop];\n  });\n});\n\nexport default unitlessNumbers;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useElementLayout/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nimport type { ElementRef } from 'react';\nimport type { LayoutEvent } from '../../types';\n\nimport useLayoutEffect from '../useLayoutEffect';\nimport UIManager from '../../exports/UIManager';\nimport canUseDOM from '../canUseDom';\n\nconst DOM_LAYOUT_HANDLER_NAME = '__reactLayoutHandler';\n\nlet didWarn = !canUseDOM;\nlet resizeObserver = null;\n\nfunction getResizeObserver(): ?ResizeObserver {\n  if (canUseDOM && typeof window.ResizeObserver !== 'undefined') {\n    if (resizeObserver == null) {\n      resizeObserver = new window.ResizeObserver(function (entries) {\n        entries.forEach((entry) => {\n          const node = entry.target;\n          const onLayout = node[DOM_LAYOUT_HANDLER_NAME];\n          if (typeof onLayout === 'function') {\n            // We still need to measure the view because browsers don't yet provide\n            // border-box dimensions in the entry\n            UIManager.measure(node, (x, y, width, height, left, top) => {\n              const event: LayoutEvent = {\n                // $FlowFixMe\n                nativeEvent: {\n                  layout: { x, y, width, height, left, top }\n                },\n                timeStamp: Date.now()\n              };\n              Object.defineProperty(event.nativeEvent, 'target', {\n                enumerable: true,\n                get: () => entry.target\n              });\n              onLayout(event);\n            });\n          }\n        });\n      });\n    }\n  } else if (!didWarn) {\n    if (\n      process.env.NODE_ENV !== 'production' &&\n      process.env.NODE_ENV !== 'test'\n    ) {\n      console.warn(\n        'onLayout relies on ResizeObserver which is not supported by your browser. ' +\n          'Please include a polyfill, e.g., https://github.com/que-etc/resize-observer-polyfill.'\n      );\n      didWarn = true;\n    }\n  }\n  return resizeObserver;\n}\n\nexport default function useElementLayout(\n  ref: ElementRef<any>,\n  onLayout?: ?(e: LayoutEvent) => void\n) {\n  const observer = getResizeObserver();\n\n  useLayoutEffect(() => {\n    const node = ref.current;\n    if (node != null) {\n      node[DOM_LAYOUT_HANDLER_NAME] = onLayout;\n    }\n  }, [ref, onLayout]);\n\n  // Observing is done in a separate effect to avoid this effect running\n  // when 'onLayout' changes.\n  useLayoutEffect(() => {\n    const node = ref.current;\n    if (node != null && observer != null) {\n      if (typeof node[DOM_LAYOUT_HANDLER_NAME] === 'function') {\n        observer.observe(node);\n      } else {\n        observer.unobserve(node);\n      }\n    }\n    return () => {\n      if (node != null && observer != null) {\n        observer.unobserve(node);\n      }\n    };\n  }, [ref, observer]);\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useEvent/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n */\n\nimport * as React from 'react';\nimport { act, render } from '@testing-library/react';\nimport { createEventTarget } from 'dom-event-testing-library';\nimport useEvent from '..';\n\ndescribe('use-event', () => {\n  describe('setListener()', () => {\n    test('event dispatched on target', () => {\n      const listener = jest.fn();\n      const targetRef = React.createRef();\n\n      function Component() {\n        const addClickListener = useEvent('click');\n        React.useEffect(() => {\n          addClickListener(targetRef.current, listener);\n        });\n        return <div ref={targetRef} />;\n      }\n\n      render(<Component />);\n\n      const target = createEventTarget(targetRef.current);\n\n      act(() => {\n        target.click();\n      });\n\n      expect(listener).toBeCalledTimes(1);\n    });\n\n    test('event dispatched on parent', () => {\n      const listener = jest.fn();\n      const listenerCapture = jest.fn();\n      const targetRef = React.createRef();\n      const parentRef = React.createRef();\n\n      function Component() {\n        const addClickListener = useEvent('click');\n        const addClickCaptureListener = useEvent('click', { capture: true });\n\n        React.useEffect(() => {\n          addClickListener(targetRef.current, listener);\n          addClickCaptureListener(targetRef.current, listenerCapture);\n        });\n        return (\n          <div ref={parentRef}>\n            <div ref={targetRef} />\n          </div>\n        );\n      }\n\n      render(<Component />);\n\n      const parent = createEventTarget(parentRef.current);\n\n      act(() => {\n        parent.click();\n      });\n\n      expect(listener).toBeCalledTimes(0);\n      expect(listenerCapture).toBeCalledTimes(0);\n    });\n\n    test('event dispatched on child', () => {\n      const log = [];\n      const listener = jest.fn(() => {\n        log.push('bubble');\n      });\n      const listenerCapture = jest.fn(() => {\n        log.push('capture');\n      });\n      const targetRef = React.createRef();\n      const childRef = React.createRef();\n\n      function Component() {\n        const addClickListener = useEvent('click');\n        const addClickCaptureListener = useEvent('click', { capture: true });\n\n        React.useEffect(() => {\n          addClickListener(targetRef.current, listener);\n          addClickCaptureListener(targetRef.current, listenerCapture);\n        });\n        return (\n          <div ref={targetRef}>\n            <div ref={childRef} />\n          </div>\n        );\n      }\n\n      render(<Component />);\n\n      const child = createEventTarget(childRef.current);\n\n      act(() => {\n        child.click();\n      });\n\n      expect(listenerCapture).toBeCalledTimes(1);\n      expect(listener).toBeCalledTimes(1);\n      expect(log).toEqual(['capture', 'bubble']);\n    });\n\n    test('event dispatched on text node', () => {\n      const listener = jest.fn();\n      const targetRef = React.createRef();\n      const childRef = React.createRef();\n\n      function Component() {\n        const addClickListener = useEvent('click');\n        React.useEffect(() => {\n          addClickListener(targetRef.current, listener);\n        });\n        return (\n          <div ref={targetRef}>\n            <div ref={childRef}>text</div>\n          </div>\n        );\n      }\n\n      render(<Component />);\n\n      const text = createEventTarget(childRef.current.firstChild);\n\n      act(() => {\n        text.click();\n      });\n\n      expect(listener).toBeCalledTimes(1);\n    });\n\n    test('listener can be attached to document ', () => {\n      const listener = jest.fn();\n      const targetRef = React.createRef();\n\n      function Component({ target }) {\n        const addClickListener = useEvent('click');\n        React.useEffect(() => {\n          addClickListener(target, listener);\n        });\n        return <div ref={targetRef} />;\n      }\n\n      render(<Component target={document} />);\n\n      const target = createEventTarget(targetRef.current);\n      act(() => {\n        target.click();\n      });\n\n      expect(listener).toBeCalledTimes(1);\n    });\n\n    test('listener can be attached to window ', () => {\n      const listener = jest.fn();\n      const targetRef = React.createRef();\n\n      function Component({ target }) {\n        const addClickListener = useEvent('click');\n        React.useEffect(() => {\n          addClickListener(target, listener);\n        });\n        return <div ref={targetRef} />;\n      }\n\n      render(<Component target={window} />);\n\n      const target = createEventTarget(targetRef.current);\n      act(() => {\n        target.click();\n      });\n\n      expect(listener).toBeCalledTimes(1);\n    });\n\n    test('listener is replaceable', () => {\n      const listener = jest.fn();\n      const listenerAlt = jest.fn();\n      const targetRef = React.createRef();\n\n      function Component({ onClick }) {\n        const addClickListener = useEvent('click');\n        React.useEffect(() => {\n          addClickListener(targetRef.current, onClick);\n        });\n        return <div ref={targetRef} />;\n      }\n\n      const { rerender } = render(<Component onClick={listener} />);\n\n      const target = createEventTarget(targetRef.current);\n      act(() => {\n        target.click();\n      });\n      expect(listener).toBeCalledTimes(1);\n\n      rerender(<Component onClick={listenerAlt} />);\n\n      act(() => {\n        target.click();\n      });\n      expect(listener).toBeCalledTimes(1);\n      expect(listenerAlt).toBeCalledTimes(1);\n    });\n\n    test('listener is removed when value is null', () => {\n      const listener = jest.fn();\n      const targetRef = React.createRef();\n\n      function Component({ off }) {\n        const addClickListener = useEvent('click');\n        React.useEffect(() => {\n          addClickListener(targetRef.current, off ? null : listener);\n        });\n        return <div ref={targetRef} />;\n      }\n\n      const { unmount } = render(<Component off={false} />);\n\n      const target = createEventTarget(targetRef.current);\n      act(() => {\n        target.click();\n      });\n      expect(listener).toBeCalledTimes(1);\n\n      // this should unset the listener\n      unmount();\n\n      listener.mockClear();\n      act(() => {\n        target.click();\n      });\n      expect(listener).toBeCalledTimes(0);\n    });\n\n    test('custom event dispatched on target', () => {\n      const listener = jest.fn();\n      const targetRef = React.createRef();\n\n      function Component() {\n        const addMagicEventListener = useEvent('magic-event');\n        React.useEffect(() => {\n          addMagicEventListener(targetRef.current, listener);\n        });\n        return <div ref={targetRef} />;\n      }\n\n      render(<Component />);\n\n      act(() => {\n        const event = new CustomEvent('magic-event', { bubbles: true });\n        targetRef.current.dispatchEvent(event);\n      });\n\n      expect(listener).toBeCalledTimes(1);\n    });\n\n    test('listeners can be set on multiple targets simultaneously', () => {\n      const log = [];\n      const targetRef = React.createRef();\n      const parentRef = React.createRef();\n      const childRef = React.createRef();\n\n      const listener = jest.fn((e) => {\n        log.push(['bubble', e.currentTarget.id]);\n      });\n      const listenerCapture = jest.fn((e) => {\n        log.push(['capture', e.currentTarget.id]);\n      });\n\n      function Component() {\n        const addClickListener = useEvent('click');\n        const addClickCaptureListener = useEvent('click', { capture: true });\n        React.useEffect(() => {\n          // the same event handle is used to set listeners on different targets\n          addClickListener(targetRef.current, listener);\n          addClickListener(parentRef.current, listener);\n          addClickCaptureListener(targetRef.current, listenerCapture);\n          addClickCaptureListener(parentRef.current, listenerCapture);\n        });\n        return (\n          <div id=\"parent\" ref={parentRef}>\n            <div id=\"target\" ref={targetRef}>\n              <div ref={childRef} />\n            </div>\n          </div>\n        );\n      }\n\n      render(<Component />);\n\n      const child = createEventTarget(childRef.current);\n\n      act(() => {\n        child.click();\n      });\n\n      expect(listenerCapture).toBeCalledTimes(2);\n      expect(listener).toBeCalledTimes(2);\n      expect(log).toEqual([\n        ['capture', 'parent'],\n        ['capture', 'target'],\n        ['bubble', 'target'],\n        ['bubble', 'parent']\n      ]);\n    });\n\n    test('listeners are specific to each event handle', () => {\n      const log = [];\n      const targetRef = React.createRef();\n      const childRef = React.createRef();\n\n      const listener = jest.fn((e) => {\n        log.push(['bubble', 'target']);\n      });\n      const listenerAlt = jest.fn((e) => {\n        log.push(['bubble', 'target-alt']);\n      });\n      const listenerCapture = jest.fn((e) => {\n        log.push(['capture', 'target']);\n      });\n      const listenerCaptureAlt = jest.fn((e) => {\n        log.push(['capture', 'target-alt']);\n      });\n\n      function Component() {\n        const addClickListener = useEvent('click');\n        const addClickAltListener = useEvent('click');\n        const addClickCaptureListener = useEvent('click', { capture: true });\n        const addClickCaptureAltListener = useEvent('click', { capture: true });\n        React.useEffect(() => {\n          addClickListener(targetRef.current, listener);\n          addClickAltListener(targetRef.current, listenerAlt);\n          addClickCaptureListener(targetRef.current, listenerCapture);\n          addClickCaptureAltListener(targetRef.current, listenerCaptureAlt);\n        });\n        return (\n          <div id=\"target\" ref={targetRef}>\n            <div ref={childRef} />\n          </div>\n        );\n      }\n\n      render(<Component />);\n\n      const child = createEventTarget(childRef.current);\n\n      act(() => {\n        child.click();\n      });\n\n      expect(listenerCapture).toBeCalledTimes(1);\n      expect(listenerCaptureAlt).toBeCalledTimes(1);\n      expect(listener).toBeCalledTimes(1);\n      expect(listenerAlt).toBeCalledTimes(1);\n      expect(log).toEqual([\n        ['capture', 'target'],\n        ['capture', 'target-alt'],\n        ['bubble', 'target'],\n        ['bubble', 'target-alt']\n      ]);\n    });\n  });\n\n  describe('cleanup', () => {\n    test('removes all listeners for given event type from targets', () => {\n      const clickListener = jest.fn();\n      function Component() {\n        const addClickListener = useEvent('click');\n        React.useEffect(() => {\n          addClickListener(document, clickListener);\n        });\n        return <div />;\n      }\n\n      const { unmount } = render(<Component />);\n      unmount();\n\n      const target = createEventTarget(document);\n\n      act(() => {\n        target.click();\n      });\n\n      expect(clickListener).toBeCalledTimes(0);\n    });\n  });\n\n  describe('stopPropagation and stopImmediatePropagation', () => {\n    test('stopPropagation works as expected', () => {\n      const childListener = jest.fn((e) => {\n        e.stopPropagation();\n      });\n      const targetListener = jest.fn();\n      const targetRef = React.createRef();\n      const childRef = React.createRef();\n\n      function Component() {\n        const addClickListener = useEvent('click');\n        React.useEffect(() => {\n          addClickListener(childRef.current, childListener);\n          addClickListener(targetRef.current, targetListener);\n        });\n        return (\n          <div ref={targetRef}>\n            <div ref={childRef} />\n          </div>\n        );\n      }\n\n      render(<Component />);\n\n      const child = createEventTarget(childRef.current);\n\n      act(() => {\n        child.click();\n      });\n\n      expect(childListener).toBeCalledTimes(1);\n      expect(targetListener).toBeCalledTimes(0);\n    });\n\n    test('stopImmediatePropagation works as expected', () => {\n      const firstListener = jest.fn((e) => {\n        e.stopImmediatePropagation();\n      });\n      const secondListener = jest.fn();\n      const targetRef = React.createRef();\n\n      function Component() {\n        const addFirstClickListener = useEvent('click');\n        const addSecondClickListener = useEvent('click');\n        React.useEffect(() => {\n          addFirstClickListener(targetRef.current, firstListener);\n          addSecondClickListener(targetRef.current, secondListener);\n        });\n        return <div ref={targetRef} />;\n      }\n\n      render(<Component />);\n\n      const target = createEventTarget(targetRef.current);\n\n      act(() => {\n        target.click();\n      });\n\n      expect(firstListener).toBeCalledTimes(1);\n      expect(secondListener).toBeCalledTimes(0);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useEvent/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport { addEventListener } from '../addEventListener';\nimport useLayoutEffect from '../useLayoutEffect';\nimport useStable from '../useStable';\n\ntype Callback = null | ((any) => void);\ntype AddListener = (\n  target: EventTarget,\n  listener: null | ((any) => void)\n) => () => void;\n\n/**\n * This can be used with any event type include custom events.\n *\n * const click = useEvent('click', options);\n * useEffect(() => {\n *   click.setListener(target, onClick);\n *   return () => click.clear();\n * }).\n */\nexport default function useEvent(\n  eventType: string,\n  options?: ?{\n    capture?: boolean,\n    passive?: boolean,\n    once?: boolean\n  }\n): AddListener {\n  const targetListeners = useStable(() => new Map());\n\n  const addListener = useStable(() => {\n    return (target: EventTarget, callback: Callback) => {\n      const removeTargetListener = targetListeners.get(target);\n      if (removeTargetListener != null) {\n        removeTargetListener();\n      }\n      if (callback == null) {\n        targetListeners.delete(target);\n        callback = () => {};\n      }\n      const removeEventListener = addEventListener(\n        target,\n        eventType,\n        callback,\n        options\n      );\n      targetListeners.set(target, removeEventListener);\n      return removeEventListener;\n    };\n  });\n\n  useLayoutEffect(() => {\n    return () => {\n      targetListeners.forEach((removeListener) => {\n        removeListener();\n      });\n      targetListeners.clear();\n    };\n  }, [targetListeners]);\n\n  return addListener;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useHover/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { act, render } from '@testing-library/react';\nimport * as React from 'react';\nimport {\n  describeWithPointerEvent,\n  clearPointers,\n  createEventTarget,\n  setPointerEvent\n} from 'dom-event-testing-library';\nimport useHover from '..';\nimport { testOnly_resetActiveModality } from '../../modality';\n\ndescribeWithPointerEvent('useHover', (hasPointerEvents) => {\n  beforeEach(() => {\n    setPointerEvent(hasPointerEvents);\n  });\n\n  afterEach(() => {\n    testOnly_resetActiveModality();\n    // make sure all tests reset state machine tracking pointers on the mock surface\n    clearPointers();\n  });\n\n  describe('contain', () => {\n    let onHoverChange, onHoverStart, onHoverUpdate, onHoverEnd, ref, childRef;\n\n    const componentInit = () => {\n      onHoverChange = jest.fn();\n      onHoverStart = jest.fn();\n      onHoverUpdate = jest.fn();\n      onHoverEnd = jest.fn();\n      ref = React.createRef();\n      childRef = React.createRef();\n      const Component = () => {\n        useHover(ref, {\n          onHoverChange,\n          onHoverStart,\n          onHoverUpdate,\n          onHoverEnd\n        });\n        useHover(childRef, { contain: true });\n        return (\n          <div ref={ref}>\n            <div ref={childRef} />\n          </div>\n        );\n      };\n      render(<Component />);\n    };\n\n    test('contains the hover gesture', () => {\n      componentInit();\n      const target = createEventTarget(ref.current);\n      const child = createEventTarget(childRef.current);\n      act(() => {\n        target.pointerover();\n        target.pointerout();\n        child.pointerover();\n      });\n      expect(onHoverEnd).toBeCalled();\n      act(() => {\n        child.pointerout();\n      });\n      expect(onHoverStart).toBeCalled();\n    });\n  });\n\n  describe('disabled', () => {\n    let onHoverChange, onHoverStart, onHoverUpdate, onHoverEnd, ref;\n\n    const componentInit = () => {\n      onHoverChange = jest.fn();\n      onHoverStart = jest.fn();\n      onHoverUpdate = jest.fn();\n      onHoverEnd = jest.fn();\n      ref = React.createRef();\n      const Component = () => {\n        useHover(ref, {\n          disabled: true,\n          onHoverChange,\n          onHoverStart,\n          onHoverUpdate,\n          onHoverEnd\n        });\n        return <div ref={ref} />;\n      };\n      render(<Component />);\n    };\n\n    test('does not call callbacks', () => {\n      componentInit();\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.pointerover();\n        target.pointerout();\n      });\n      expect(onHoverChange).not.toBeCalled();\n      expect(onHoverStart).not.toBeCalled();\n      expect(onHoverUpdate).not.toBeCalled();\n      expect(onHoverEnd).not.toBeCalled();\n    });\n  });\n\n  describe('onHoverStart', () => {\n    let onHoverStart, ref;\n\n    const componentInit = () => {\n      onHoverStart = jest.fn();\n      ref = React.createRef();\n      const Component = () => {\n        useHover(ref, { onHoverStart });\n        return <div ref={ref} />;\n      };\n      render(<Component />);\n    };\n\n    test('is called for mouse pointers', () => {\n      componentInit();\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.pointerover({ pointerType: 'mouse' });\n      });\n      expect(onHoverStart).toBeCalledTimes(1);\n    });\n\n    test('is not called for touch pointers', () => {\n      componentInit();\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.pointerdown({ pointerType: 'touch' });\n        target.pointerup({ pointerType: 'touch' });\n      });\n      expect(onHoverStart).not.toBeCalled();\n    });\n\n    test('is called if a mouse pointer is used after a touch pointer', () => {\n      componentInit();\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.pointerdown({ pointerType: 'touch' });\n        target.pointerup({ pointerType: 'touch' });\n        target.pointerover({ pointerType: 'mouse' });\n      });\n      expect(onHoverStart).toBeCalledTimes(1);\n    });\n  });\n\n  describe('onHoverChange', () => {\n    let onHoverChange, ref;\n\n    const componentInit = () => {\n      onHoverChange = jest.fn();\n      ref = React.createRef();\n      const Component = () => {\n        useHover(ref, { onHoverChange });\n        return <div ref={ref} />;\n      };\n      render(<Component />);\n    };\n\n    test('is called for mouse pointers', () => {\n      componentInit();\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.pointerover();\n      });\n      expect(onHoverChange).toBeCalledTimes(1);\n      expect(onHoverChange).toBeCalledWith(true);\n      act(() => {\n        target.pointerout();\n      });\n      expect(onHoverChange).toBeCalledTimes(2);\n      expect(onHoverChange).toBeCalledWith(false);\n    });\n\n    test('is not called for touch pointers', () => {\n      componentInit();\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.pointerdown({ pointerType: 'touch' });\n        target.pointerup({ pointerType: 'touch' });\n      });\n      expect(onHoverChange).not.toBeCalled();\n    });\n  });\n\n  describe('onHoverEnd', () => {\n    let onHoverEnd, ref, childRef;\n\n    const componentInit = () => {\n      onHoverEnd = jest.fn();\n      ref = React.createRef();\n      childRef = React.createRef();\n      const Component = () => {\n        useHover(ref, { onHoverEnd });\n        return (\n          <div ref={ref}>\n            <div ref={childRef} />\n          </div>\n        );\n      };\n      render(<Component />);\n    };\n\n    test('is called for mouse pointers', () => {\n      componentInit();\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.pointerover();\n        target.pointerout();\n      });\n      expect(onHoverEnd).toBeCalledTimes(1);\n    });\n\n    test('is not called for touch pointers', () => {\n      componentInit();\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.pointerdown({ pointerType: 'touch' });\n        target.pointerup({ pointerType: 'touch' });\n      });\n      expect(onHoverEnd).not.toBeCalled();\n    });\n\n    test('is not called when entering children of the target', () => {\n      componentInit();\n      const target = createEventTarget(ref.current);\n      const child = createEventTarget(childRef.current);\n      act(() => {\n        target.pointerover();\n        target.pointerout({ relatedTarget: childRef.current });\n        child.pointerover({ relatedTarget: target.node });\n      });\n      expect(onHoverEnd).not.toBeCalled();\n    });\n  });\n\n  describe('onHoverUpdate', () => {\n    test('is called after the active pointer moves\"', () => {\n      const onHoverUpdate = jest.fn();\n      const ref = React.createRef();\n      const Component = () => {\n        useHover(ref, { onHoverUpdate });\n        return <div ref={ref} />;\n      };\n      render(<Component />);\n\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.pointerover();\n        target.pointerhover({ x: 0, y: 0 });\n        target.pointerhover({ x: 1, y: 1 });\n      });\n      expect(onHoverUpdate).toBeCalledTimes(2);\n    });\n  });\n\n  describe('repeat use', () => {\n    let onHoverChange, onHoverStart, onHoverUpdate, onHoverEnd, ref;\n\n    const componentInit = () => {\n      onHoverChange = jest.fn();\n      onHoverStart = jest.fn();\n      onHoverUpdate = jest.fn();\n      onHoverEnd = jest.fn();\n      ref = React.createRef();\n      const Component = () => {\n        useHover(ref, {\n          onHoverChange,\n          onHoverStart,\n          onHoverUpdate,\n          onHoverEnd\n        });\n        return <div ref={ref} />;\n      };\n      render(<Component />);\n    };\n\n    test('callbacks are called each time', () => {\n      componentInit();\n      const target = createEventTarget(ref.current);\n      act(() => {\n        target.pointerover();\n        target.pointerhover({ x: 1, y: 1 });\n        target.pointerout();\n      });\n      expect(onHoverStart).toBeCalledTimes(1);\n      expect(onHoverUpdate).toBeCalledTimes(1);\n      expect(onHoverEnd).toBeCalledTimes(1);\n      expect(onHoverChange).toBeCalledTimes(2);\n      act(() => {\n        target.pointerover();\n        target.pointerhover({ x: 1, y: 1 });\n        target.pointerout();\n      });\n      expect(onHoverStart).toBeCalledTimes(2);\n      expect(onHoverUpdate).toBeCalledTimes(2);\n      expect(onHoverEnd).toBeCalledTimes(2);\n      expect(onHoverChange).toBeCalledTimes(4);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useHover/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport { getModality } from '../modality';\nimport useEvent from '../useEvent';\nimport useLayoutEffect from '../useLayoutEffect';\n\n/**\n * Types\n */\n\nexport type HoverEventsConfig = {\n  contain?: ?boolean,\n  disabled?: ?boolean,\n  onHoverStart?: ?(e: any) => void,\n  onHoverChange?: ?(bool: boolean) => void,\n  onHoverUpdate?: ?(e: any) => void,\n  onHoverEnd?: ?(e: any) => void\n};\n\n/**\n * Implementation\n */\n\nconst emptyObject = {};\nconst opts = { passive: true };\nconst lockEventType = 'react-gui:hover:lock';\nconst unlockEventType = 'react-gui:hover:unlock';\nconst supportsPointerEvent = () =>\n  !!(typeof window !== 'undefined' && window.PointerEvent != null);\n\nfunction dispatchCustomEvent(\n  target: EventTarget,\n  type: string,\n  payload?: {\n    bubbles?: boolean,\n    cancelable?: boolean,\n    detail?: { [key: string]: mixed }\n  }\n) {\n  const event = document.createEvent('CustomEvent');\n  const { bubbles = true, cancelable = true, detail } = payload || emptyObject;\n  event.initCustomEvent(type, bubbles, cancelable, detail);\n  target.dispatchEvent(event);\n}\n\n// This accounts for the non-PointerEvent fallback events.\nfunction getPointerType(event) {\n  const { pointerType } = event;\n  return pointerType != null ? pointerType : getModality();\n}\n\nexport default function useHover(\n  targetRef: any,\n  config: HoverEventsConfig\n): void {\n  const {\n    contain,\n    disabled,\n    onHoverStart,\n    onHoverChange,\n    onHoverUpdate,\n    onHoverEnd\n  } = config;\n\n  const canUsePE = supportsPointerEvent();\n\n  const addMoveListener = useEvent(\n    canUsePE ? 'pointermove' : 'mousemove',\n    opts\n  );\n  const addEnterListener = useEvent(\n    canUsePE ? 'pointerenter' : 'mouseenter',\n    opts\n  );\n  const addLeaveListener = useEvent(\n    canUsePE ? 'pointerleave' : 'mouseleave',\n    opts\n  );\n  // These custom events are used to implement the \"contain\" prop.\n  const addLockListener = useEvent(lockEventType, opts);\n  const addUnlockListener = useEvent(unlockEventType, opts);\n\n  useLayoutEffect(() => {\n    const target = targetRef.current;\n    if (target !== null) {\n      /**\n       * End the hover gesture\n       */\n      const hoverEnd = function (e) {\n        if (onHoverEnd != null) {\n          onHoverEnd(e);\n        }\n        if (onHoverChange != null) {\n          onHoverChange(false);\n        }\n        // Remove the listeners once finished.\n        addMoveListener(target, null);\n        addLeaveListener(target, null);\n      };\n\n      /**\n       * Leave element\n       */\n      const leaveListener = function (e) {\n        const target = targetRef.current;\n        if (target != null && getPointerType(e) !== 'touch') {\n          if (contain) {\n            dispatchCustomEvent(target, unlockEventType);\n          }\n          hoverEnd(e);\n        }\n      };\n\n      /**\n       * Move within element\n       */\n      const moveListener = function (e) {\n        if (getPointerType(e) !== 'touch') {\n          if (onHoverUpdate != null) {\n            // Not all browsers have these properties\n            if (e.x == null) {\n              e.x = e.clientX;\n            }\n            if (e.y == null) {\n              e.y = e.clientY;\n            }\n            onHoverUpdate(e);\n          }\n        }\n      };\n\n      /**\n       * Start the hover gesture\n       */\n      const hoverStart = function (e) {\n        if (onHoverStart != null) {\n          onHoverStart(e);\n        }\n        if (onHoverChange != null) {\n          onHoverChange(true);\n        }\n        // Set the listeners needed for the rest of the hover gesture.\n        if (onHoverUpdate != null) {\n          addMoveListener(target, !disabled ? moveListener : null);\n        }\n        addLeaveListener(target, !disabled ? leaveListener : null);\n      };\n\n      /**\n       * Enter element\n       */\n      const enterListener = function (e) {\n        const target = targetRef.current;\n        if (target != null && getPointerType(e) !== 'touch') {\n          if (contain) {\n            dispatchCustomEvent(target, lockEventType);\n          }\n          hoverStart(e);\n          const lockListener = function (lockEvent) {\n            if (lockEvent.target !== target) {\n              hoverEnd(e);\n            }\n          };\n          const unlockListener = function (lockEvent) {\n            if (lockEvent.target !== target) {\n              hoverStart(e);\n            }\n          };\n          addLockListener(target, !disabled ? lockListener : null);\n          addUnlockListener(target, !disabled ? unlockListener : null);\n        }\n      };\n\n      addEnterListener(target, !disabled ? enterListener : null);\n    }\n  }, [\n    addEnterListener,\n    addMoveListener,\n    addLeaveListener,\n    addLockListener,\n    addUnlockListener,\n    contain,\n    disabled,\n    onHoverStart,\n    onHoverChange,\n    onHoverUpdate,\n    onHoverEnd,\n    targetRef\n  ]);\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useLayoutEffect/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * useLayoutEffect throws an error on the server. On the few occasions where is\n * problematic, use this hook.\n *\n * @flow\n */\n\nimport { useEffect, useLayoutEffect } from 'react';\nimport canUseDOM from '../canUseDom';\n\nconst useLayoutEffectImpl: typeof useLayoutEffect = canUseDOM\n  ? useLayoutEffect\n  : useEffect;\n\nexport default useLayoutEffectImpl;\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useLocale/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow strict\n */\n\nimport type { Node } from 'react';\n\nimport React, { createContext, useContext } from 'react';\nimport { isLocaleRTL } from './isLocaleRTL';\n\ntype Locale = string;\ntype WritingDirection = 'ltr' | 'rtl';\n\ntype LocaleValue = {\n  // Locale writing direction.\n  direction: WritingDirection,\n  // Locale BCP47 language code: https://www.ietf.org/rfc/bcp/bcp47.txt\n  locale: ?Locale\n};\n\ntype ProviderProps = {\n  ...LocaleValue,\n  children: any\n};\n\nconst defaultLocale = {\n  direction: 'ltr',\n  locale: 'en-US'\n};\n\nconst LocaleContext = createContext<LocaleValue>(defaultLocale);\n\nexport function getLocaleDirection(locale: Locale): WritingDirection {\n  return isLocaleRTL(locale) ? 'rtl' : 'ltr';\n}\n\nexport function LocaleProvider(props: ProviderProps): Node {\n  const { direction, locale, children } = props;\n  const needsContext = direction || locale;\n\n  return needsContext ? (\n    <LocaleContext.Provider\n      children={children}\n      value={{\n        direction: locale ? getLocaleDirection(locale) : direction,\n        locale\n      }}\n    />\n  ) : (\n    children\n  );\n}\n\nexport function useLocaleContext(): LocaleValue {\n  return useContext(LocaleContext);\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useLocale/isLocaleRTL.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nconst rtlScripts = new Set([\n  'Arab',\n  'Syrc',\n  'Samr',\n  'Mand',\n  'Thaa',\n  'Mend',\n  'Nkoo',\n  'Adlm',\n  'Rohg',\n  'Hebr'\n]);\n\nconst rtlLangs = new Set([\n  'ae', // Avestan\n  'ar', // Arabic\n  'arc', // Aramaic\n  'bcc', // Southern Balochi\n  'bqi', // Bakthiari\n  'ckb', // Sorani\n  'dv', // Dhivehi\n  'fa',\n  'far', // Persian\n  'glk', // Gilaki\n  'he',\n  'iw', // Hebrew\n  'khw', // Khowar\n  'ks', // Kashmiri\n  'ku', // Kurdish\n  'mzn', // Mazanderani\n  'nqo', // N'Ko\n  'pnb', // Western Punjabi\n  'ps', // Pashto\n  'sd', // Sindhi\n  'ug', // Uyghur\n  'ur', // Urdu\n  'yi' // Yiddish\n]);\n\nconst cache = new Map();\n\n/**\n * Determine the writing direction of a locale\n */\nexport function isLocaleRTL(locale: string): boolean {\n  const cachedRTL = cache.get(locale);\n  if (cachedRTL) {\n    return cachedRTL;\n  }\n\n  let isRTL = false;\n  // $FlowFixMe\n  if (Intl.Locale) {\n    try {\n      // $FlowFixMe\n      const script = new Intl.Locale(locale).maximize().script;\n      isRTL = rtlScripts.has(script);\n    } catch {\n      // RangeError: Incorrect locale information provided\n      // Fallback to inferring from language\n      const lang = locale.split('-')[0];\n      isRTL = rtlLangs.has(lang);\n    }\n  } else {\n    // Fallback to inferring from language\n    const lang = locale.split('-')[0];\n    isRTL = rtlLangs.has(lang);\n  }\n\n  cache.set(locale, isRTL);\n  return isRTL;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useMergeRefs/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport * as React from 'react';\nimport { act, render } from '@testing-library/react';\nimport useMergeRefs from '..';\n\ndescribe('modules/useMergeRefs', () => {\n  function TestComponent({ refs, ...rest }) {\n    const mergedRef = useMergeRefs(...refs);\n    return <div ref={mergedRef} {...rest} />;\n  }\n\n  test('handles no refs', () => {\n    act(() => {\n      render(<TestComponent refs={[]} />);\n    });\n  });\n\n  test('merges any number of varying refs', () => {\n    const callbackRef1 = jest.fn();\n    const callbackRef2 = jest.fn();\n    const objectRef1 = React.createRef();\n    const objectRef2 = React.createRef();\n    const nullRef = null;\n\n    act(() => {\n      render(\n        <TestComponent\n          refs={[callbackRef1, callbackRef2, objectRef1, objectRef2, nullRef]}\n        />\n      );\n    });\n\n    expect(callbackRef1).toHaveBeenCalledTimes(1);\n    expect(callbackRef2).toHaveBeenCalledTimes(1);\n    expect(objectRef1.current).toBeInstanceOf(HTMLDivElement);\n    expect(objectRef2.current).toBeInstanceOf(HTMLDivElement);\n  });\n\n  test('ref is called when ref changes', () => {\n    const ref = jest.fn();\n    const nextRef = jest.fn();\n    let rerender;\n\n    act(() => {\n      ({ rerender } = render(<TestComponent refs={[ref]} />));\n    });\n    expect(ref).toHaveBeenCalled();\n    act(() => {\n      rerender(<TestComponent refs={[nextRef]} />);\n    });\n    expect(nextRef).toHaveBeenCalled();\n  });\n\n  test('ref is not called for each rerender', () => {\n    const ref = jest.fn();\n    let rerender;\n\n    act(() => {\n      ({ rerender } = render(<TestComponent refs={[ref]} />));\n    });\n    expect(ref).toHaveBeenCalledTimes(1);\n    act(() => {\n      rerender(<TestComponent refs={[ref]} />);\n    });\n    expect(ref).toHaveBeenCalledTimes(1);\n  });\n\n  test('ref is not called for props changes', () => {\n    const ref = jest.fn();\n    let rerender;\n\n    act(() => {\n      ({ rerender } = render(<TestComponent id=\"foo\" refs={[ref]} />));\n    });\n    expect(ref).toHaveBeenCalledTimes(1);\n    act(() => {\n      rerender(<TestComponent id=\"bar\" refs={[ref]} />);\n    });\n    expect(ref).toHaveBeenCalledTimes(1);\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useMergeRefs/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n */\n\nimport * as React from 'react';\nimport mergeRefs from '../mergeRefs';\n\nexport default function useMergeRefs(\n  ...args: $ReadOnlyArray<React.ElementRef<any>>\n): (node: HTMLElement | null) => void {\n  return React.useMemo(\n    () => mergeRefs(...args),\n    // eslint-disable-next-line\n    [...args]\n  );\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/usePlatformMethods/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nimport type { GenericStyleProp } from '../../types';\nimport type { ViewProps } from '../../exports/View';\n\nimport UIManager from '../../exports/UIManager';\nimport useStable from '../useStable';\n\n/**\n * Adds non-standard methods to the hode element. This is temporarily until an\n * API like `ReactNative.measure(hostRef, callback)` is added to React Native.\n */\nexport default function usePlatformMethods({\n  pointerEvents,\n  style\n}: {\n  style?: GenericStyleProp<*>,\n  pointerEvents?: $PropertyType<ViewProps, 'pointerEvents'>\n}): (hostNode: any) => void {\n  // Avoid creating a new ref on every render.\n  const ref = useStable(() => (hostNode: any) => {\n    if (hostNode != null) {\n      hostNode.measure = (callback) => UIManager.measure(hostNode, callback);\n      hostNode.measureLayout = (relativeToNode, success, failure) =>\n        UIManager.measureLayout(hostNode, relativeToNode, failure, success);\n      hostNode.measureInWindow = (callback) =>\n        UIManager.measureInWindow(hostNode, callback);\n    }\n  });\n\n  return ref;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/usePressEvents/PressResponder.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\n'use strict';\n\ntype ClickEvent = any;\ntype KeyboardEvent = any;\ntype ResponderEvent = any;\n\nexport type PressResponderConfig = $ReadOnly<{|\n  // The gesture can be interrupted by a parent gesture, e.g., scroll.\n  // Defaults to true.\n  cancelable?: ?boolean,\n  // Whether to disable initialization of the press gesture.\n  disabled?: ?boolean,\n  // Duration (in addition to `delayPressStart`) after which a press gesture is\n  // considered a long press gesture. Defaults to 500 (milliseconds).\n  delayLongPress?: ?number,\n  // Duration to wait after press down before calling `onPressStart`.\n  delayPressStart?: ?number,\n  // Duration to wait after letting up before calling `onPressEnd`.\n  delayPressEnd?: ?number,\n  // Called when a long press gesture has been triggered.\n  onLongPress?: ?(event: ResponderEvent) => void,\n  // Called when a press gestute has been triggered.\n  onPress?: ?(event: ClickEvent) => void,\n  // Called when the press is activated to provide visual feedback.\n  onPressChange?: ?(event: ResponderEvent) => void,\n  // Called when the press is activated to provide visual feedback.\n  onPressStart?: ?(event: ResponderEvent) => void,\n  // Called when the press location moves. (This should rarely be used.)\n  onPressMove?: ?(event: ResponderEvent) => void,\n  // Called when the press is deactivated to undo visual feedback.\n  onPressEnd?: ?(event: ResponderEvent) => void\n|}>;\n\nexport type EventHandlers = $ReadOnly<{|\n  onClick: (event: ClickEvent) => void,\n  onContextMenu: (event: ClickEvent) => void,\n  onKeyDown: (event: KeyboardEvent) => void,\n  onResponderGrant: (event: ResponderEvent) => void,\n  onResponderMove: (event: ResponderEvent) => void,\n  onResponderRelease: (event: ResponderEvent) => void,\n  onResponderTerminate: (event: ResponderEvent) => void,\n  onResponderTerminationRequest: (event: ResponderEvent) => boolean,\n  onStartShouldSetResponder: (event: ResponderEvent) => boolean\n|}>;\n\ntype TouchState =\n  | 'NOT_RESPONDER'\n  | 'RESPONDER_INACTIVE_PRESS_START'\n  | 'RESPONDER_ACTIVE_PRESS_START'\n  | 'RESPONDER_ACTIVE_LONG_PRESS_START'\n  | 'ERROR';\n\ntype TouchSignal =\n  | 'DELAY'\n  | 'RESPONDER_GRANT'\n  | 'RESPONDER_RELEASE'\n  | 'RESPONDER_TERMINATED'\n  | 'LONG_PRESS_DETECTED';\n\nconst DELAY = 'DELAY';\nconst ERROR = 'ERROR';\nconst LONG_PRESS_DETECTED = 'LONG_PRESS_DETECTED';\nconst NOT_RESPONDER = 'NOT_RESPONDER';\nconst RESPONDER_ACTIVE_LONG_PRESS_START = 'RESPONDER_ACTIVE_LONG_PRESS_START';\nconst RESPONDER_ACTIVE_PRESS_START = 'RESPONDER_ACTIVE_PRESS_START';\nconst RESPONDER_INACTIVE_PRESS_START = 'RESPONDER_INACTIVE_PRESS_START';\nconst RESPONDER_GRANT = 'RESPONDER_GRANT';\nconst RESPONDER_RELEASE = 'RESPONDER_RELEASE';\nconst RESPONDER_TERMINATED = 'RESPONDER_TERMINATED';\n\nconst Transitions = Object.freeze({\n  NOT_RESPONDER: {\n    DELAY: ERROR,\n    RESPONDER_GRANT: RESPONDER_INACTIVE_PRESS_START,\n    RESPONDER_RELEASE: ERROR,\n    RESPONDER_TERMINATED: ERROR,\n    LONG_PRESS_DETECTED: ERROR\n  },\n  RESPONDER_INACTIVE_PRESS_START: {\n    DELAY: RESPONDER_ACTIVE_PRESS_START,\n    RESPONDER_GRANT: ERROR,\n    RESPONDER_RELEASE: NOT_RESPONDER,\n    RESPONDER_TERMINATED: NOT_RESPONDER,\n    LONG_PRESS_DETECTED: ERROR\n  },\n  RESPONDER_ACTIVE_PRESS_START: {\n    DELAY: ERROR,\n    RESPONDER_GRANT: ERROR,\n    RESPONDER_RELEASE: NOT_RESPONDER,\n    RESPONDER_TERMINATED: NOT_RESPONDER,\n    LONG_PRESS_DETECTED: RESPONDER_ACTIVE_LONG_PRESS_START\n  },\n  RESPONDER_ACTIVE_LONG_PRESS_START: {\n    DELAY: ERROR,\n    RESPONDER_GRANT: ERROR,\n    RESPONDER_RELEASE: NOT_RESPONDER,\n    RESPONDER_TERMINATED: NOT_RESPONDER,\n    LONG_PRESS_DETECTED: RESPONDER_ACTIVE_LONG_PRESS_START\n  },\n  ERROR: {\n    DELAY: NOT_RESPONDER,\n    RESPONDER_GRANT: RESPONDER_INACTIVE_PRESS_START,\n    RESPONDER_RELEASE: NOT_RESPONDER,\n    RESPONDER_TERMINATED: NOT_RESPONDER,\n    LONG_PRESS_DETECTED: NOT_RESPONDER\n  }\n});\n\nconst getElementRole = (element) => element.getAttribute('role');\n\nconst getElementType = (element) => element.tagName.toLowerCase();\n\nconst isActiveSignal = (signal) =>\n  signal === RESPONDER_ACTIVE_PRESS_START ||\n  signal === RESPONDER_ACTIVE_LONG_PRESS_START;\n\nconst isButtonRole = (element) => getElementRole(element) === 'button';\n\nconst isPressStartSignal = (signal) =>\n  signal === RESPONDER_INACTIVE_PRESS_START ||\n  signal === RESPONDER_ACTIVE_PRESS_START ||\n  signal === RESPONDER_ACTIVE_LONG_PRESS_START;\n\nconst isTerminalSignal = (signal) =>\n  signal === RESPONDER_TERMINATED || signal === RESPONDER_RELEASE;\n\nconst isValidKeyPress = (event) => {\n  const { key, target } = event;\n  const isSpacebar = key === ' ' || key === 'Spacebar';\n  const isButtonish =\n    getElementType(target) === 'button' || isButtonRole(target);\n  return key === 'Enter' || (isSpacebar && isButtonish);\n};\n\nconst DEFAULT_LONG_PRESS_DELAY_MS = 450; // 500 - 50\nconst DEFAULT_PRESS_DELAY_MS = 50;\n\n/**\n * =========================== PressResponder Tutorial ===========================\n *\n * The `PressResponder` class helps you create press interactions by analyzing the\n * geometry of elements and observing when another responder (e.g. ScrollView)\n * has stolen the touch lock. It offers hooks for your component to provide\n * interaction feedback to the user:\n *\n * - When a press has activated (e.g. highlight an element)\n * - When a press has deactivated (e.g. un-highlight an element)\n * - When a press sould trigger an action, meaning it activated and deactivated\n *   while within the geometry of the element without the lock being stolen.\n *\n * A high quality interaction isn't as simple as you might think. There should\n * be a slight delay before activation. Moving your finger beyond an element's\n * bounds should trigger deactivation, but moving the same finger back within an\n * element's bounds should trigger reactivation.\n *\n * In order to use `PressResponder`, do the following:\n *\n *     const pressResponder = new PressResponder(config);\n *\n * 2. Choose the rendered component who should collect the press events. On that\n *    element, spread `pressability.getEventHandlers()` into its props.\n *\n *    return (\n *      <View {...this.state.pressResponder.getEventHandlers()} />\n *    );\n *\n * 3. Reset `PressResponder` when your component unmounts.\n *\n *    componentWillUnmount() {\n *      this.state.pressResponder.reset();\n *    }\n *\n * ==================== Implementation Details ====================\n *\n * `PressResponder` only assumes that there exists a `HitRect` node. The `PressRect`\n * is an abstract box that is extended beyond the `HitRect`.\n *\n * # Geometry\n *\n *  ┌────────────────────────┐\n *  │  ┌──────────────────┐  │ - Presses start anywhere within `HitRect`.\n *  │  │  ┌────────────┐  │  │\n *  │  │  │ VisualRect │  │  │\n *  │  │  └────────────┘  │  │ - When pressed down for sufficient amount of time\n *  │  │    HitRect       │  │   before letting up, `VisualRect` activates.\n *  │  └──────────────────┘  │\n *  │       Out Region   o   │\n *  └────────────────────│───┘\n *                       └────── When the press is released outside the `HitRect`,\n *                               the responder is NOT eligible for a \"press\".\n *\n * # State Machine\n *\n * ┌───────────────┐ ◀──── RESPONDER_RELEASE\n * │ NOT_RESPONDER │\n * └───┬───────────┘ ◀──── RESPONDER_TERMINATED\n *     │\n *     │ RESPONDER_GRANT (HitRect)\n *     │\n *     ▼\n * ┌─────────────────────┐          ┌───────────────────┐              ┌───────────────────┐\n * │ RESPONDER_INACTIVE_ │  DELAY   │ RESPONDER_ACTIVE_ │  T + DELAY   │ RESPONDER_ACTIVE_ │\n * │ PRESS_START         ├────────▶ │ PRESS_START       ├────────────▶ │ LONG_PRESS_START  │\n * └─────────────────────┘          └───────────────────┘              └───────────────────┘\n *\n * T + DELAY => LONG_PRESS_DELAY + DELAY\n *\n * Not drawn are the side effects of each transition. The most important side\n * effect is the invocation of `onLongPress`. Only when the browser produces a\n * `click` event is `onPress` invoked.\n */\nexport default class PressResponder {\n  _config: PressResponderConfig;\n  _eventHandlers: ?EventHandlers = null;\n  _isPointerTouch: ?boolean = false;\n  _longPressDelayTimeout: ?TimeoutID = null;\n  _longPressDispatched: ?boolean = false;\n  _pressDelayTimeout: ?TimeoutID = null;\n  _pressOutDelayTimeout: ?TimeoutID = null;\n  _selectionTerminated: ?boolean;\n  _touchActivatePosition: ?$ReadOnly<{|\n    pageX: number,\n    pageY: number\n  |}>;\n  _touchState: TouchState = NOT_RESPONDER;\n  _responderElement: ?HTMLElement = null;\n\n  constructor(config: PressResponderConfig) {\n    this.configure(config);\n  }\n\n  configure(config: PressResponderConfig): void {\n    this._config = config;\n  }\n\n  /**\n   * Resets any pending timers. This should be called on unmount.\n   */\n  reset(): void {\n    this._cancelLongPressDelayTimeout();\n    this._cancelPressDelayTimeout();\n    this._cancelPressOutDelayTimeout();\n  }\n\n  /**\n   * Returns a set of props to spread into the interactive element.\n   */\n  getEventHandlers(): EventHandlers {\n    if (this._eventHandlers == null) {\n      this._eventHandlers = this._createEventHandlers();\n    }\n    return this._eventHandlers;\n  }\n\n  _createEventHandlers(): EventHandlers {\n    const start = (event: ResponderEvent, shouldDelay?: boolean): void => {\n      event.persist();\n\n      this._cancelPressOutDelayTimeout();\n\n      this._longPressDispatched = false;\n      this._selectionTerminated = false;\n      this._touchState = NOT_RESPONDER;\n      this._isPointerTouch = event.nativeEvent.type === 'touchstart';\n\n      this._receiveSignal(RESPONDER_GRANT, event);\n\n      const delayPressStart = normalizeDelay(\n        this._config.delayPressStart,\n        0,\n        DEFAULT_PRESS_DELAY_MS\n      );\n\n      if (shouldDelay !== false && delayPressStart > 0) {\n        this._pressDelayTimeout = setTimeout(() => {\n          this._receiveSignal(DELAY, event);\n        }, delayPressStart);\n      } else {\n        this._receiveSignal(DELAY, event);\n      }\n\n      const delayLongPress = normalizeDelay(\n        this._config.delayLongPress,\n        10,\n        DEFAULT_LONG_PRESS_DELAY_MS\n      );\n      this._longPressDelayTimeout = setTimeout(() => {\n        this._handleLongPress(event);\n      }, delayLongPress + delayPressStart);\n    };\n\n    const end = (event: ResponderEvent): void => {\n      this._receiveSignal(RESPONDER_RELEASE, event);\n    };\n\n    const keyupHandler = (event: KeyboardEvent) => {\n      const { onPress } = this._config;\n      const { target } = event;\n\n      if (this._touchState !== NOT_RESPONDER && isValidKeyPress(event)) {\n        end(event);\n        document.removeEventListener('keyup', keyupHandler);\n\n        const role = target.getAttribute('role');\n        const elementType = getElementType(target);\n\n        const isNativeInteractiveElement =\n          role === 'link' ||\n          elementType === 'a' ||\n          elementType === 'button' ||\n          elementType === 'input' ||\n          elementType === 'select' ||\n          elementType === 'textarea';\n        const isActiveElement = this._responderElement === target;\n\n        if (onPress != null && !isNativeInteractiveElement && isActiveElement) {\n          onPress(event);\n        }\n\n        this._responderElement = null;\n      }\n    };\n\n    return {\n      onStartShouldSetResponder: (event): boolean => {\n        const { disabled } = this._config;\n        if (disabled && isButtonRole(event.currentTarget)) {\n          event.stopPropagation();\n        }\n        if (disabled == null) {\n          return true;\n        }\n        return !disabled;\n      },\n\n      onKeyDown: (event) => {\n        const { disabled } = this._config;\n        const { key, target } = event;\n        if (!disabled && isValidKeyPress(event)) {\n          if (this._touchState === NOT_RESPONDER) {\n            start(event, false);\n            this._responderElement = target;\n            // Listen to 'keyup' on document to account for situations where\n            // focus is moved to another element during 'keydown'.\n            document.addEventListener('keyup', keyupHandler);\n          }\n          const isSpacebarKey = key === ' ' || key === 'Spacebar';\n          const role = getElementRole(target);\n          const isButtonLikeRole = role === 'button' || role === 'menuitem';\n          if (\n            isSpacebarKey &&\n            isButtonLikeRole &&\n            getElementType(target) !== 'button'\n          ) {\n            // Prevent spacebar scrolling the window if using non-native button\n            event.preventDefault();\n          }\n          event.stopPropagation();\n        }\n      },\n\n      onResponderGrant: (event) => start(event),\n\n      onResponderMove: (event) => {\n        if (this._config.onPressMove != null) {\n          this._config.onPressMove(event);\n        }\n        const touch = getTouchFromResponderEvent(event);\n        if (this._touchActivatePosition != null) {\n          const deltaX = this._touchActivatePosition.pageX - touch.pageX;\n          const deltaY = this._touchActivatePosition.pageY - touch.pageY;\n          if (Math.hypot(deltaX, deltaY) > 10) {\n            this._cancelLongPressDelayTimeout();\n          }\n        }\n      },\n\n      onResponderRelease: (event) => end(event),\n\n      onResponderTerminate: (event) => {\n        if (event.nativeEvent.type === 'selectionchange') {\n          this._selectionTerminated = true;\n        }\n        this._receiveSignal(RESPONDER_TERMINATED, event);\n      },\n\n      onResponderTerminationRequest: (event): boolean => {\n        const { cancelable, disabled, onLongPress } = this._config;\n        // If `onLongPress` is provided, don't terminate on `contextmenu` as default\n        // behavior will be prevented for non-mouse pointers.\n        if (\n          !disabled &&\n          onLongPress != null &&\n          this._isPointerTouch &&\n          event.nativeEvent.type === 'contextmenu'\n        ) {\n          return false;\n        }\n        if (cancelable == null) {\n          return true;\n        }\n        return cancelable;\n      },\n\n      // NOTE: this diverges from react-native in 3 significant ways:\n      // * The `onPress` callback is not connected to the responder system (the native\n      //  `click` event must be used but is dispatched in many scenarios where no pointers\n      //   are on the screen.) Therefore, it's possible for `onPress` to be called without\n      //   `onPress{Start,End}` being called first.\n      // * The `onPress` callback is only be called on the first ancestor of the native\n      //   `click` target that is using the PressResponder.\n      // * The event's `nativeEvent` is a `MouseEvent` not a `TouchEvent`.\n      onClick: (event: any): void => {\n        const { disabled, onPress } = this._config;\n        if (!disabled) {\n          // If long press dispatched, cancel default click behavior.\n          // If the responder terminated because text was selected during the gesture,\n          // cancel the default click behavior.\n          event.stopPropagation();\n          if (this._longPressDispatched || this._selectionTerminated) {\n            event.preventDefault();\n          } else if (onPress != null && event.altKey === false) {\n            onPress(event);\n          }\n        } else {\n          if (isButtonRole(event.currentTarget)) {\n            event.stopPropagation();\n          }\n        }\n      },\n\n      // If `onLongPress` is provided and a touch pointer is being used, prevent the\n      // default context menu from opening.\n      onContextMenu: (event: any): void => {\n        const { disabled, onLongPress } = this._config;\n        if (!disabled) {\n          if (\n            onLongPress != null &&\n            this._isPointerTouch &&\n            !event.defaultPrevented\n          ) {\n            event.preventDefault();\n            event.stopPropagation();\n          }\n        } else {\n          if (isButtonRole(event.currentTarget)) {\n            event.stopPropagation();\n          }\n        }\n      }\n    };\n  }\n\n  /**\n   * Receives a state machine signal, performs side effects of the transition\n   * and stores the new state. Validates the transition as well.\n   */\n  _receiveSignal(signal: TouchSignal, event: ResponderEvent): void {\n    const prevState = this._touchState;\n    let nextState = null;\n    if (Transitions[prevState] != null) {\n      nextState = Transitions[prevState][signal];\n    }\n    if (this._touchState === NOT_RESPONDER && signal === RESPONDER_RELEASE) {\n      return;\n    }\n    if (nextState == null || nextState === ERROR) {\n      console.error(\n        `PressResponder: Invalid signal ${signal} for state ${prevState} on responder`\n      );\n    } else if (prevState !== nextState) {\n      this._performTransitionSideEffects(prevState, nextState, signal, event);\n      this._touchState = nextState;\n    }\n  }\n\n  /**\n   * Performs a transition between touchable states and identify any activations\n   * or deactivations (and callback invocations).\n   */\n  _performTransitionSideEffects(\n    prevState: TouchState,\n    nextState: TouchState,\n    signal: TouchSignal,\n    event: ResponderEvent\n  ): void {\n    if (isTerminalSignal(signal)) {\n      // Pressable suppression of contextmenu on windows.\n      // On Windows, the contextmenu is displayed after pointerup.\n      // https://github.com/necolas/react-native-web/issues/2296\n      setTimeout(() => {\n        this._isPointerTouch = false;\n      }, 0);\n      this._touchActivatePosition = null;\n      this._cancelLongPressDelayTimeout();\n    }\n\n    if (isPressStartSignal(prevState) && signal === LONG_PRESS_DETECTED) {\n      const { onLongPress } = this._config;\n      // Long press is not supported for keyboards because 'click' can be dispatched\n      // immediately (and multiple times) after 'keydown'.\n      if (onLongPress != null && event.nativeEvent.key == null) {\n        onLongPress(event);\n        this._longPressDispatched = true;\n      }\n    }\n\n    const isPrevActive = isActiveSignal(prevState);\n    const isNextActive = isActiveSignal(nextState);\n\n    if (!isPrevActive && isNextActive) {\n      this._activate(event);\n    } else if (isPrevActive && !isNextActive) {\n      this._deactivate(event);\n    }\n\n    if (isPressStartSignal(prevState) && signal === RESPONDER_RELEASE) {\n      const { onLongPress, onPress } = this._config;\n      if (onPress != null) {\n        const isPressCanceledByLongPress =\n          onLongPress != null &&\n          prevState === RESPONDER_ACTIVE_LONG_PRESS_START;\n        if (!isPressCanceledByLongPress) {\n          // If we never activated (due to delays), activate and deactivate now.\n          if (!isNextActive && !isPrevActive) {\n            this._activate(event);\n            this._deactivate(event);\n          }\n        }\n      }\n    }\n\n    this._cancelPressDelayTimeout();\n  }\n\n  _activate(event: ResponderEvent): void {\n    const { onPressChange, onPressStart } = this._config;\n    const touch = getTouchFromResponderEvent(event);\n    this._touchActivatePosition = {\n      pageX: touch.pageX,\n      pageY: touch.pageY\n    };\n    if (onPressStart != null) {\n      onPressStart(event);\n    }\n    if (onPressChange != null) {\n      onPressChange(true);\n    }\n  }\n\n  _deactivate(event: ResponderEvent): void {\n    const { onPressChange, onPressEnd } = this._config;\n    function end() {\n      if (onPressEnd != null) {\n        onPressEnd(event);\n      }\n      if (onPressChange != null) {\n        onPressChange(false);\n      }\n    }\n    const delayPressEnd = normalizeDelay(this._config.delayPressEnd);\n    if (delayPressEnd > 0) {\n      this._pressOutDelayTimeout = setTimeout(() => {\n        end();\n      }, delayPressEnd);\n    } else {\n      end();\n    }\n  }\n\n  _handleLongPress(event: ResponderEvent): void {\n    if (\n      this._touchState === RESPONDER_ACTIVE_PRESS_START ||\n      this._touchState === RESPONDER_ACTIVE_LONG_PRESS_START\n    ) {\n      this._receiveSignal(LONG_PRESS_DETECTED, event);\n    }\n  }\n\n  _cancelLongPressDelayTimeout(): void {\n    if (this._longPressDelayTimeout != null) {\n      clearTimeout(this._longPressDelayTimeout);\n      this._longPressDelayTimeout = null;\n    }\n  }\n\n  _cancelPressDelayTimeout(): void {\n    if (this._pressDelayTimeout != null) {\n      clearTimeout(this._pressDelayTimeout);\n      this._pressDelayTimeout = null;\n    }\n  }\n\n  _cancelPressOutDelayTimeout(): void {\n    if (this._pressOutDelayTimeout != null) {\n      clearTimeout(this._pressOutDelayTimeout);\n      this._pressOutDelayTimeout = null;\n    }\n  }\n}\n\nfunction normalizeDelay(delay: ?number, min = 0, fallback = 0): number {\n  return Math.max(min, delay ?? fallback);\n}\n\nfunction getTouchFromResponderEvent(event: ResponderEvent) {\n  const { changedTouches, touches } = event.nativeEvent;\n  if (touches != null && touches.length > 0) {\n    return touches[0];\n  }\n  if (changedTouches != null && changedTouches.length > 0) {\n    return changedTouches[0];\n  }\n  return event.nativeEvent;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/usePressEvents/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\n'use strict';\n\nimport type { EventHandlers, PressResponderConfig } from './PressResponder';\n\nimport PressResponder from './PressResponder';\nimport { useDebugValue, useEffect, useRef } from 'react';\n\nexport default function usePressEvents(\n  hostRef: any,\n  config: PressResponderConfig\n): EventHandlers {\n  const pressResponderRef = useRef<?PressResponder>(null);\n  if (pressResponderRef.current == null) {\n    pressResponderRef.current = new PressResponder(config);\n  }\n  const pressResponder = pressResponderRef.current;\n\n  // Re-configure to use the current node and configuration.\n  useEffect(() => {\n    pressResponder.configure(config);\n  }, [config, pressResponder]);\n\n  // Reset the `pressResponder` when cleanup needs to occur. This is\n  // a separate effect because we do not want to rest the responder when `config` changes.\n  useEffect(() => {\n    return () => {\n      pressResponder.reset();\n    };\n  }, [pressResponder]);\n\n  useDebugValue(config);\n\n  return pressResponder.getEventHandlers();\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useResponderEvents/README.md",
    "content": "# Responder Event System\n\nThe Responder Event System is a gesture system that manages the lifecycle of gestures. It was designed for [React Native](https://reactnative.dev/docs/next/gesture-responder-system) to help support the development of native-quality gestures. A pointer may transition through several different phases while the gesture is being determined (e.g., tap, scroll, swipe) and be used simultaneously alongside other pointers. The Responder Event System provides a single, global “interaction lock” on views. For a view to become the “responder” means that pointer interactions are exclusive to that view and none other. A view can negotiate to become the “responder” without requiring knowledge of other views.\n\nNOTE: Although the responder events mention only `touches`, this is for historical reasons (originating from React Native); the system does respond to mouse events which are converted into emulated touches. In the future we could adjust the events to align more with the `PointerEvent` API which would remove this ambiguity and surface more information to developers (e.g., `pointerType`).\n\n## How it works\n\nA view can become the \"responder\" after the following native events: `scroll`, `selectionchange`, `touchstart`, `touchmove`, `mousedown`, `mousemove`. If nothing is already the \"responder\", the event propagates to (capture) and from (bubble) the event target until a view returns `true` for `on*ShouldSetResponder(Capture)`.\n \nIf something is *already* the responder, the negotiation event propagates to (capture) and from (bubble) the lowest common ancestor of the event target and the current responder. Then negotiation happens between the current responder and the view that wants to become the responder.\n\n## API\n\n### useResponderEvents\n\nThe `useResponderEvents` hook takes a ref to a host element and an object of responder callbacks.\n\n```js\nfunction View(props) {\n  const hostRef = useRef(null);\n\n  const callbacks: ResponderCallbacks = {\n    onMoveShouldSetResponder: props.onMoveShouldSetResponder,\n    onMoveShouldSetResponderCapture: props.onMoveShouldSetResponderCapture,\n    onResponderEnd: props.onResponderEnd,\n    onResponderGrant: props.onResponderGrant,\n    onResponderMove: props.onResponderMove,\n    onResponderReject: props.onResponderReject,\n    onResponderRelease: props.onResponderRelease,\n    onResponderStart: props.onResponderStart,\n    onResponderTerminate: props.onResponderTerminate,\n    onResponderTerminationRequest: props.onResponderTerminationRequest,\n    onScrollShouldSetResponder: props.onScrollShouldSetResponder,\n    onScrollShouldSetResponderCapture: props.onScrollShouldSetResponderCapture,\n    onSelectionChangeShouldSetResponder: props.onSelectionChangeShouldSetResponder,\n    onSelectionChangeShouldSetResponderCapture: props.onSelectionChangeShouldSetResponderCapture,\n    onStartShouldSetResponder: props.onStartShouldSetResponder,\n    onStartShouldSetResponderCapture: props.onStartShouldSetResponderCapture\n  }\n\n  useResponderEvents(hostRef, callbacks);\n\n  return (\n    <div ref={hostRef} />\n  );\n}\n```\n\n### Responder negotiation\n\nA view can become the responder by using the negotiation methods. During the capture phase the deepest node is called last. During the bubble phase the deepest node is called first. The capture phase should be used when a view wants to prevent a descendant from becoming the responder. The first view to return `true` from any of the `on*ShouldSetResponderCapture`/`on*ShouldSetResponder` methods will either become the responder or enter into negotiation with the existing responder.\n\nN.B. If `stopPropagation` is called on the event for any of the negotiation methods, it only stops further negotiation within the Responder System. It will not stop the propagation of the native event (which has already bubbled to the `document` by this time.)\n\n#### onStartShouldSetResponder / onStartShouldSetResponderCapture\n\nOn pointer down, should this view attempt to become the responder? If the view is not the responder, these methods may be called for every pointer start on the view.\n\n#### onMoveShouldSetResponder / onMoveShouldSetResponderCapture\n\nOn pointer move, should this view attempt to become the responder? If the view is not the responder, these methods may be called for every pointer move on the view.\n\n#### onScrollShouldSetResponder / onScrollShouldSetResponderCapture\n\nOn scroll, should this view attempt to become the responder? If the view is not the responder, these methods may be called for every scroll on the view.\n\n#### onSelectionChangeShouldSetResponder / onSelectionChangeShouldSetResponderCapture\n\nOn text selection change, should this view attempt to become the responder? Does not capture or bubble and is only called on the view that is the first ancestor of the selection `anchorNode`.\n\n#### onResponderTerminationRequest\n\nThe view is the responder, but another view now wants to become the responder. Should this view release the responder? Returning `true` allows the responder to be released.\n\n### Responder transfer\n\nIf a view returns `true` for a negotiation method then it will either become the responder (if none exists) or be involved in the responder transfer. The following methods are called only for the views involved in the responder transfer (i.e., no bubbling.)\n\n#### onResponderGrant\n\nThe view is granted the responder and is now responding to pointer events. The lifecycle methods will be called for this view. This is the point at which you should provide visual feedback for users that the interaction has begun.\n\n#### onResponderReject\n\nThe view was not granted the responder. It was rejected because another view is already the responder and will not release it.\n\n#### onResponderTerminate\n\nThe responder has been taken from this view. It may have been taken by another view after a call to `onResponderTerminationRequest`, or it might have been taken by the browser without asking (e.g., window blur, document scroll, context menu open). This is the point at which you should provide visual feedback for users that the interaction has been cancelled.\n\n### Responder lifecycle\n\nIf a view is the responder, the following methods will be called only for this view (i.e., no bubbling.) These methods are *always* bookended by `onResponderGrant` (before) and either `onResponderRelease` or `onResponderTerminate` (after).\n\n#### onResponderStart\n\nA pointer down event occured on the screen. The responder is notified of all start events, even if the pointer target is not this view (i.e., additional pointers are being used). Therefore, this method may be called multiple times while the view is the responder.\n\n#### onResponderMove\n\nA pointer move event occured on the screen. The responder is notified of all move events, even if the pointer target is not this view (i.e., additional pointers are being used). Therefore, this method may be called multiple times while the view is the responder.\n\n#### onResponderEnd\n\nA pointer up event occured on the screen. The responder is notified of all end events, even if the pointer target is not this view (i.e., additional pointers are being used). Therefore, this method may be called multiple times while the view is the responder.\n\n#### onResponderRelease\n\nAs soon as there are no more pointers that *started* inside descendants of the responder, this method is called on the responder and the interaction lock is released. This is the point at which you should provide visual feedback for users that the interaction is over.\n\n### Responder events\n\nEvery method is called with a responder event. The type of the event is shown below. The `currentTarget` of the event is always `null` for the negotiation methods. Data dervied from the native events, e.g., the native `target` and pointer coordinates, can be used to determine the return value of the negotiation methods, etc.\n\n## Types\n\n```js\ntype ResponderCallbacks = {\n  onResponderEnd?: ?(e: ResponderEvent) => void,\n  onResponderGrant?: ?(e: ResponderEvent) => void,\n  onResponderMove?: ?(e: ResponderEvent) => void,\n  onResponderRelease?: ?(e: ResponderEvent) => void,\n  onResponderReject?: ?(e: ResponderEvent) => void,\n  onResponderStart?: ?(e: ResponderEvent) => void,\n  onResponderTerminate?: ?(e: ResponderEvent) => void,\n  onResponderTerminationRequest?: ?(e: ResponderEvent) => boolean,\n  onStartShouldSetResponder?: ?(e: ResponderEvent) => boolean,\n  onStartShouldSetResponderCapture?: ?(e: ResponderEvent) => boolean,\n  onMoveShouldSetResponder?: ?(e: ResponderEvent) => boolean,\n  onMoveShouldSetResponderCapture?: ?(e: ResponderEvent) => boolean,\n  onScrollShouldSetResponder?: ?(e: ResponderEvent) => boolean,\n  onScrollShouldSetResponderCapture?: ?(e: ResponderEvent) => boolean,\n  onSelectionChangeShouldSetResponder?: ?(e: ResponderEvent) => boolean,\n  onSelectionChangeShouldSetResponderCapture?: ?(e: ResponderEvent) => boolean\n};\n```\n\n```js\ntype ResponderEvent = {\n  // The DOM element acting as the responder view\n  currentTarget: ?HTMLElement,\n  defaultPrevented: boolean,\n  eventPhase: ?number,\n  isDefaultPrevented: () => boolean,\n  isPropagationStopped: () => boolean,\n  isTrusted: boolean,\n  preventDefault: () => void,\n  stopPropagation: () => void,\n  nativeEvent: TouchEvent,\n  persist: () => void,\n  target: HTMLElement,\n  timeStamp: number,\n  touchHistory: $ReadOnly<{|\n    indexOfSingleActiveTouch: number,\n    mostRecentTimeStamp: number,\n    numberActiveTouches: number,\n    touchBank: Array<{|\n      currentPageX: number,\n      currentPageY: number,\n      currentTimeStamp: number,\n      previousPageX: number,\n      previousPageY: number,\n      previousTimeStamp: number,\n      startPageX: number,\n      startPageY: number,\n      startTimeStamp: number,\n      touchActive: boolean\n    |}>\n  |}>\n};\n```\n\n```js\ntype TouchEvent = {\n  // Array of all touch events that have changed since the last event\n  changedTouches: Array<Touch>,\n  force: number,\n  // ID of the touch\n  identifier: number,\n  // The X position of the pointer, relative to the currentTarget\n  locationX: number,\n  // The Y position of the pointer, relative to the currentTarget\n  locationY: number,\n  // The X position of the pointer, relative to the page\n  pageX: number,\n  // The Y position of the pointer, relative to the page\n  pageY: number,\n  // The DOM element receiving the pointer event\n  target: HTMLElement,\n  // A time identifier for the pointer, useful for velocity calculation\n  timestamp: number,\n  // Array of all current touches on the screen\n  touches: Array<Touch>\n};\n```\n\n```js\ntype Touch = {\n  force: number,\n  identifier: number,\n  locationX: number,\n  locationY: number,\n  pageX: number,\n  pageY: number,\n  target: HTMLElement,\n  timestamp: number\n};\n```\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useResponderEvents/ResponderEventTypes.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher\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 * @flow\n */\n\nexport type Touch = {\n  force: number,\n  identifier: number,\n  // The locationX and locationY properties are non-standard additions\n  locationX: any,\n  locationY: any,\n  pageX: number,\n  pageY: number,\n  target: any,\n  // Touches in a list have a timestamp property\n  timestamp: number\n};\n\nexport type TouchEvent = {\n  altKey: boolean,\n  ctrlKey: boolean,\n  metaKey: boolean,\n  shiftKey: boolean,\n  // TouchList is an array in the Responder system\n  changedTouches: Array<Touch>,\n  force: number,\n  // React Native adds properties to the \"nativeEvent that are usually only found on W3C Touches ‾\\_(ツ)_/‾\n  identifier: number,\n  locationX: any,\n  locationY: any,\n  pageX: number,\n  pageY: number,\n  target: any,\n  // The timestamp has a lowercase \"s\" in the Responder system\n  timestamp: number,\n  // TouchList is an array in the Responder system\n  touches: Array<Touch>\n};\n\nexport const BLUR = 'blur';\nexport const CONTEXT_MENU = 'contextmenu';\nexport const FOCUS_OUT = 'focusout';\nexport const MOUSE_DOWN = 'mousedown';\nexport const MOUSE_MOVE = 'mousemove';\nexport const MOUSE_UP = 'mouseup';\nexport const MOUSE_CANCEL = 'dragstart';\nexport const TOUCH_START = 'touchstart';\nexport const TOUCH_MOVE = 'touchmove';\nexport const TOUCH_END = 'touchend';\nexport const TOUCH_CANCEL = 'touchcancel';\nexport const SCROLL = 'scroll';\nexport const SELECT = 'select';\nexport const SELECTION_CHANGE = 'selectionchange';\n\nexport function isStartish(eventType: mixed): boolean {\n  return eventType === TOUCH_START || eventType === MOUSE_DOWN;\n}\n\nexport function isMoveish(eventType: mixed): boolean {\n  return eventType === TOUCH_MOVE || eventType === MOUSE_MOVE;\n}\n\nexport function isEndish(eventType: mixed): boolean {\n  return (\n    eventType === TOUCH_END || eventType === MOUSE_UP || isCancelish(eventType)\n  );\n}\n\nexport function isCancelish(eventType: mixed): boolean {\n  return eventType === TOUCH_CANCEL || eventType === MOUSE_CANCEL;\n}\n\nexport function isScroll(eventType: mixed): boolean {\n  return eventType === SCROLL;\n}\n\nexport function isSelectionChange(eventType: mixed): boolean {\n  return eventType === SELECT || eventType === SELECTION_CHANGE;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useResponderEvents/ResponderSystem.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher\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 * @flow\n */\n\n/**\n * RESPONDER EVENT SYSTEM\n *\n * A single, global \"interaction lock\" on views. For a view to be the \"responder\" means\n * that pointer interactions are exclusive to that view and none other. The \"interaction\n * lock\" can be transferred (only) to ancestors of the current \"responder\" as long as\n * pointers continue to be active.\n *\n * Responder being granted:\n *\n * A view can become the \"responder\" after the following events:\n *  * \"pointerdown\" (implemented using \"touchstart\", \"mousedown\")\n *  * \"pointermove\" (implemented using \"touchmove\", \"mousemove\")\n *  * \"scroll\" (while a pointer is down)\n *  * \"selectionchange\" (while a pointer is down)\n *\n * If nothing is already the \"responder\", the event propagates to (capture) and from\n * (bubble) the event target until a view returns `true` for\n * `on*ShouldSetResponder(Capture)`.\n *\n * If something is already the responder, the event propagates to (capture) and from\n * (bubble) the lowest common ancestor of the event target and the current \"responder\".\n * Then negotiation happens between the current \"responder\" and a view that wants to\n * become the \"responder\": see the timing diagram below.\n *\n * (NOTE: Scrolled views either automatically become the \"responder\" or release the\n * \"interaction lock\". A native scroll view that isn't built on top of the responder\n * system must result in the current \"responder\" being notified that it no longer has\n * the \"interaction lock\" - the native system has taken over.\n *\n * Responder being released:\n *\n * As soon as there are no more active pointers that *started* inside descendants\n * of the *current* \"responder\", an `onResponderRelease` event is dispatched to the\n * current \"responder\", and the responder lock is released.\n *\n * Typical sequence of events:\n *  * startShouldSetResponder\n *  * responderGrant/Reject\n *  * responderStart\n *  * responderMove\n *  * responderEnd\n *  * responderRelease\n */\n\n/*                                             Negotiation Performed\n                                             +-----------------------+\n                                            /                         \\\nProcess low level events to    +     Current Responder      +   wantsResponderID\ndetermine who to perform negot-|   (if any exists at all)   |\niation/transition              | Otherwise just pass through|\n-------------------------------+----------------------------+------------------+\nBubble to find first ID        |                            |\nto return true:wantsResponderID|                            |\n                               |                            |\n     +--------------+          |                            |\n     | onTouchStart |          |                            |\n     +------+-------+    none  |                            |\n            |            return|                            |\n+-----------v-------------+true| +------------------------+ |\n|onStartShouldSetResponder|----->| onResponderStart (cur) |<-----------+\n+-----------+-------------+    | +------------------------+ |          |\n            |                  |                            | +--------+-------+\n            | returned true for|       false:REJECT +-------->|onResponderReject\n            | wantsResponderID |                    |       | +----------------+\n            | (now attempt     | +------------------+-----+ |\n            |  handoff)        | | onResponder            | |\n            +------------------->|    TerminationRequest  | |\n                               | +------------------+-----+ |\n                               |                    |       | +----------------+\n                               |         true:GRANT +-------->|onResponderGrant|\n                               |                            | +--------+-------+\n                               | +------------------------+ |          |\n                               | | onResponderTerminate   |<-----------+\n                               | +------------------+-----+ |\n                               |                    |       | +----------------+\n                               |                    +-------->|onResponderStart|\n                               |                            | +----------------+\nBubble to find first ID        |                            |\nto return true:wantsResponderID|                            |\n                               |                            |\n     +-------------+           |                            |\n     | onTouchMove |           |                            |\n     +------+------+     none  |                            |\n            |            return|                            |\n+-----------v-------------+true| +------------------------+ |\n|onMoveShouldSetResponder |----->| onResponderMove (cur)  |<-----------+\n+-----------+-------------+    | +------------------------+ |          |\n            |                  |                            | +--------+-------+\n            | returned true for|       false:REJECT +-------->|onResponderReject\n            | wantsResponderID |                    |       | +----------------+\n            | (now attempt     | +------------------+-----+ |\n            |  handoff)        | |   onResponder          | |\n            +------------------->|      TerminationRequest| |\n                               | +------------------+-----+ |\n                               |                    |       | +----------------+\n                               |         true:GRANT +-------->|onResponderGrant|\n                               |                            | +--------+-------+\n                               | +------------------------+ |          |\n                               | |   onResponderTerminate |<-----------+\n                               | +------------------+-----+ |\n                               |                    |       | +----------------+\n                               |                    +-------->|onResponderMove |\n                               |                            | +----------------+\n                               |                            |\n                               |                            |\n      Some active touch started|                            |\n      inside current responder | +------------------------+ |\n      +------------------------->|      onResponderEnd    | |\n      |                        | +------------------------+ |\n  +---+---------+              |                            |\n  | onTouchEnd  |              |                            |\n  +---+---------+              |                            |\n      |                        | +------------------------+ |\n      +------------------------->|     onResponderEnd     | |\n      No active touches started| +-----------+------------+ |\n      inside current responder |             |              |\n                               |             v              |\n                               | +------------------------+ |\n                               | |    onResponderRelease  | |\n                               | +------------------------+ |\n                               |                            |\n                               +                            + */\n\nimport type { ResponderEvent } from './createResponderEvent';\n\nimport createResponderEvent from './createResponderEvent';\nimport {\n  isCancelish,\n  isEndish,\n  isMoveish,\n  isScroll,\n  isSelectionChange,\n  isStartish\n} from './ResponderEventTypes';\nimport {\n  getLowestCommonAncestor,\n  getResponderPaths,\n  hasTargetTouches,\n  hasValidSelection,\n  isPrimaryPointerDown,\n  setResponderId\n} from './utils';\nimport { ResponderTouchHistoryStore } from './ResponderTouchHistoryStore';\nimport canUseDOM from '../canUseDom';\n\n/* ------------ TYPES ------------ */\n\ntype ResponderId = number;\n\ntype ActiveResponderInstance = {\n  id: ResponderId,\n  idPath: Array<number>,\n  node: any\n};\n\ntype EmptyResponderInstance = {\n  id: null,\n  idPath: null,\n  node: null\n};\n\ntype ResponderInstance = ActiveResponderInstance | EmptyResponderInstance;\n\nexport type ResponderConfig = {\n  // Direct responder events dispatched directly to responder. Do not bubble.\n  onResponderEnd?: ?(e: ResponderEvent) => void,\n  onResponderGrant?: ?(e: ResponderEvent) => void | boolean,\n  onResponderMove?: ?(e: ResponderEvent) => void,\n  onResponderRelease?: ?(e: ResponderEvent) => void,\n  onResponderReject?: ?(e: ResponderEvent) => void,\n  onResponderStart?: ?(e: ResponderEvent) => void,\n  onResponderTerminate?: ?(e: ResponderEvent) => void,\n  onResponderTerminationRequest?: ?(e: ResponderEvent) => boolean,\n  // On pointer down, should this element become the responder?\n  onStartShouldSetResponder?: ?(e: ResponderEvent) => boolean,\n  onStartShouldSetResponderCapture?: ?(e: ResponderEvent) => boolean,\n  // On pointer move, should this element become the responder?\n  onMoveShouldSetResponder?: ?(e: ResponderEvent) => boolean,\n  onMoveShouldSetResponderCapture?: ?(e: ResponderEvent) => boolean,\n  // On scroll, should this element become the responder? Do no bubble\n  onScrollShouldSetResponder?: ?(e: ResponderEvent) => boolean,\n  onScrollShouldSetResponderCapture?: ?(e: ResponderEvent) => boolean,\n  // On text selection change, should this element become the responder?\n  onSelectionChangeShouldSetResponder?: ?(e: ResponderEvent) => boolean,\n  onSelectionChangeShouldSetResponderCapture?: ?(e: ResponderEvent) => boolean\n};\n\nconst emptyObject = {};\n\n/* ------------ IMPLEMENTATION ------------ */\n\nconst startRegistration = [\n  'onStartShouldSetResponderCapture',\n  'onStartShouldSetResponder',\n  { bubbles: true }\n];\nconst moveRegistration = [\n  'onMoveShouldSetResponderCapture',\n  'onMoveShouldSetResponder',\n  { bubbles: true }\n];\nconst scrollRegistration = [\n  'onScrollShouldSetResponderCapture',\n  'onScrollShouldSetResponder',\n  { bubbles: false }\n];\nconst shouldSetResponderEvents = {\n  touchstart: startRegistration,\n  mousedown: startRegistration,\n  touchmove: moveRegistration,\n  mousemove: moveRegistration,\n  scroll: scrollRegistration\n};\n\nconst emptyResponder = { id: null, idPath: null, node: null };\nconst responderListenersMap = new Map();\n\nlet isEmulatingMouseEvents = false;\nlet trackedTouchCount = 0;\nlet currentResponder: ResponderInstance = {\n  id: null,\n  node: null,\n  idPath: null\n};\nconst responderTouchHistoryStore = new ResponderTouchHistoryStore();\n\nfunction changeCurrentResponder(responder: ResponderInstance) {\n  currentResponder = responder;\n}\n\nfunction getResponderConfig(id: ResponderId): ResponderConfig | Object {\n  const config = responderListenersMap.get(id);\n  return config != null ? config : emptyObject;\n}\n\n/**\n * Process native events\n *\n * A single event listener is used to manage the responder system.\n * All pointers are tracked in the ResponderTouchHistoryStore. Native events\n * are interpreted in terms of the Responder System and checked to see if\n * the responder should be transferred. Each host node that is attached to\n * the Responder System has an ID, which is used to look up its associated\n * callbacks.\n */\nfunction eventListener(domEvent: any) {\n  const eventType = domEvent.type;\n  const eventTarget = domEvent.target;\n\n  /**\n   * Manage emulated events and early bailout.\n   * Since PointerEvent is not used yet (lack of support in older Safari), it's\n   * necessary to manually manage the mess of browser touch/mouse events.\n   * And bailout early for termination events when there is no active responder.\n   */\n\n  // Flag when browser may produce emulated events\n  if (eventType === 'touchstart') {\n    isEmulatingMouseEvents = true;\n  }\n  // Remove flag when browser will not produce emulated events\n  if (eventType === 'touchmove' || trackedTouchCount > 1) {\n    isEmulatingMouseEvents = false;\n  }\n  // Ignore various events in particular circumstances\n  if (\n    // Ignore browser emulated mouse events\n    (eventType === 'mousedown' && isEmulatingMouseEvents) ||\n    (eventType === 'mousemove' && isEmulatingMouseEvents) ||\n    // Ignore mousemove if a mousedown didn't occur first\n    (eventType === 'mousemove' && trackedTouchCount < 1)\n  ) {\n    return;\n  }\n  // Remove flag after emulated events are finished\n  if (isEmulatingMouseEvents && eventType === 'mouseup') {\n    if (trackedTouchCount === 0) {\n      isEmulatingMouseEvents = false;\n    }\n    return;\n  }\n\n  const isStartEvent = isStartish(eventType) && isPrimaryPointerDown(domEvent);\n  const isMoveEvent = isMoveish(eventType);\n  const isEndEvent = isEndish(eventType);\n  const isScrollEvent = isScroll(eventType);\n  const isSelectionChangeEvent = isSelectionChange(eventType);\n  const responderEvent = createResponderEvent(\n    domEvent,\n    responderTouchHistoryStore\n  );\n\n  /**\n   * Record the state of active pointers\n   */\n\n  if (isStartEvent || isMoveEvent || isEndEvent) {\n    if (domEvent.touches) {\n      trackedTouchCount = domEvent.touches.length;\n    } else {\n      if (isStartEvent) {\n        trackedTouchCount = 1;\n      } else if (isEndEvent) {\n        trackedTouchCount = 0;\n      }\n    }\n    responderTouchHistoryStore.recordTouchTrack(\n      eventType,\n      responderEvent.nativeEvent\n    );\n  }\n\n  /**\n   * Responder System logic\n   */\n\n  let eventPaths = getResponderPaths(domEvent);\n  let wasNegotiated = false;\n  let wantsResponder;\n\n  // If an event occured that might change the current responder...\n  if (isStartEvent || isMoveEvent || (isScrollEvent && trackedTouchCount > 0)) {\n    // If there is already a responder, prune the event paths to the lowest common ancestor\n    // of the existing responder and deepest target of the event.\n    const currentResponderIdPath = currentResponder.idPath;\n    const eventIdPath = eventPaths.idPath;\n\n    if (currentResponderIdPath != null && eventIdPath != null) {\n      const lowestCommonAncestor = getLowestCommonAncestor(\n        currentResponderIdPath,\n        eventIdPath\n      );\n      if (lowestCommonAncestor != null) {\n        const indexOfLowestCommonAncestor =\n          eventIdPath.indexOf(lowestCommonAncestor);\n        // Skip the current responder so it doesn't receive unexpected \"shouldSet\" events.\n        const index =\n          indexOfLowestCommonAncestor +\n          (lowestCommonAncestor === currentResponder.id ? 1 : 0);\n        eventPaths = {\n          idPath: eventIdPath.slice(index),\n          nodePath: eventPaths.nodePath.slice(index)\n        };\n      } else {\n        eventPaths = null;\n      }\n    }\n\n    if (eventPaths != null) {\n      // If a node wants to become the responder, attempt to transfer.\n      wantsResponder = findWantsResponder(eventPaths, domEvent, responderEvent);\n      if (wantsResponder != null) {\n        // Sets responder if none exists, or negotates with existing responder.\n        attemptTransfer(responderEvent, wantsResponder);\n        wasNegotiated = true;\n      }\n    }\n  }\n\n  // If there is now a responder, invoke its callbacks for the lifecycle of the gesture.\n  if (currentResponder.id != null && currentResponder.node != null) {\n    const { id, node } = currentResponder;\n    const {\n      onResponderStart,\n      onResponderMove,\n      onResponderEnd,\n      onResponderRelease,\n      onResponderTerminate,\n      onResponderTerminationRequest\n    } = getResponderConfig(id);\n\n    responderEvent.bubbles = false;\n    responderEvent.cancelable = false;\n    responderEvent.currentTarget = node;\n\n    // Start\n    if (isStartEvent) {\n      if (onResponderStart != null) {\n        responderEvent.dispatchConfig.registrationName = 'onResponderStart';\n        onResponderStart(responderEvent);\n      }\n    }\n    // Move\n    else if (isMoveEvent) {\n      if (onResponderMove != null) {\n        responderEvent.dispatchConfig.registrationName = 'onResponderMove';\n        onResponderMove(responderEvent);\n      }\n    } else {\n      const isTerminateEvent =\n        isCancelish(eventType) ||\n        // native context menu\n        eventType === 'contextmenu' ||\n        // window blur\n        (eventType === 'blur' && eventTarget === window) ||\n        // responder (or ancestors) blur\n        (eventType === 'blur' &&\n          eventTarget.contains(node) &&\n          domEvent.relatedTarget !== node) ||\n        // native scroll without using a pointer\n        (isScrollEvent && trackedTouchCount === 0) ||\n        // native scroll on node that is parent of the responder (allow siblings to scroll)\n        (isScrollEvent && eventTarget.contains(node) && eventTarget !== node) ||\n        // native select/selectionchange on node\n        (isSelectionChangeEvent && hasValidSelection(domEvent));\n\n      const isReleaseEvent =\n        isEndEvent &&\n        !isTerminateEvent &&\n        !hasTargetTouches(node, domEvent.touches);\n\n      // End\n      if (isEndEvent) {\n        if (onResponderEnd != null) {\n          responderEvent.dispatchConfig.registrationName = 'onResponderEnd';\n          onResponderEnd(responderEvent);\n        }\n      }\n      // Release\n      if (isReleaseEvent) {\n        if (onResponderRelease != null) {\n          responderEvent.dispatchConfig.registrationName = 'onResponderRelease';\n          onResponderRelease(responderEvent);\n        }\n        changeCurrentResponder(emptyResponder);\n      }\n      // Terminate\n      if (isTerminateEvent) {\n        let shouldTerminate = true;\n\n        // Responders can still avoid termination but only for these events.\n        if (\n          eventType === 'contextmenu' ||\n          eventType === 'scroll' ||\n          eventType === 'selectionchange'\n        ) {\n          // Only call this function is it wasn't already called during negotiation.\n          if (wasNegotiated) {\n            shouldTerminate = false;\n          } else if (onResponderTerminationRequest != null) {\n            responderEvent.dispatchConfig.registrationName =\n              'onResponderTerminationRequest';\n            if (onResponderTerminationRequest(responderEvent) === false) {\n              shouldTerminate = false;\n            }\n          }\n        }\n\n        if (shouldTerminate) {\n          if (onResponderTerminate != null) {\n            responderEvent.dispatchConfig.registrationName =\n              'onResponderTerminate';\n            onResponderTerminate(responderEvent);\n          }\n          changeCurrentResponder(emptyResponder);\n          isEmulatingMouseEvents = false;\n          trackedTouchCount = 0;\n        }\n      }\n    }\n  }\n}\n\n/**\n * Walk the event path to/from the target node. At each node, stop and call the\n * relevant \"shouldSet\" functions for the given event type. If any of those functions\n * call \"stopPropagation\" on the event, stop searching for a responder.\n */\nfunction findWantsResponder(eventPaths, domEvent, responderEvent) {\n  const shouldSetCallbacks = shouldSetResponderEvents[(domEvent.type: any)]; // for Flow\n\n  if (shouldSetCallbacks != null) {\n    const { idPath, nodePath } = eventPaths;\n\n    const shouldSetCallbackCaptureName = shouldSetCallbacks[0];\n    const shouldSetCallbackBubbleName = shouldSetCallbacks[1];\n    const { bubbles } = shouldSetCallbacks[2];\n\n    const check = function (id, node, callbackName) {\n      const config = getResponderConfig(id);\n      const shouldSetCallback = config[callbackName];\n      if (shouldSetCallback != null) {\n        responderEvent.currentTarget = node;\n        if (shouldSetCallback(responderEvent) === true) {\n          // Start the path from the potential responder\n          const prunedIdPath = idPath.slice(idPath.indexOf(id));\n          return { id, node, idPath: prunedIdPath };\n        }\n      }\n    };\n\n    // capture\n    for (let i = idPath.length - 1; i >= 0; i--) {\n      const id = idPath[i];\n      const node = nodePath[i];\n      const result = check(id, node, shouldSetCallbackCaptureName);\n      if (result != null) {\n        return result;\n      }\n      if (responderEvent.isPropagationStopped() === true) {\n        return;\n      }\n    }\n\n    // bubble\n    if (bubbles) {\n      for (let i = 0; i < idPath.length; i++) {\n        const id = idPath[i];\n        const node = nodePath[i];\n        const result = check(id, node, shouldSetCallbackBubbleName);\n        if (result != null) {\n          return result;\n        }\n        if (responderEvent.isPropagationStopped() === true) {\n          return;\n        }\n      }\n    } else {\n      const id = idPath[0];\n      const node = nodePath[0];\n      const target = domEvent.target;\n      if (target === node) {\n        return check(id, node, shouldSetCallbackBubbleName);\n      }\n    }\n  }\n}\n\n/**\n * Attempt to transfer the responder.\n */\nfunction attemptTransfer(\n  responderEvent: ResponderEvent,\n  wantsResponder: ActiveResponderInstance\n) {\n  const { id: currentId, node: currentNode } = currentResponder;\n  const { id, node } = wantsResponder;\n\n  const { onResponderGrant, onResponderReject } = getResponderConfig(id);\n\n  responderEvent.bubbles = false;\n  responderEvent.cancelable = false;\n  responderEvent.currentTarget = node;\n\n  // Set responder\n  if (currentId == null) {\n    if (onResponderGrant != null) {\n      responderEvent.currentTarget = node;\n      responderEvent.dispatchConfig.registrationName = 'onResponderGrant';\n      onResponderGrant(responderEvent);\n    }\n    changeCurrentResponder(wantsResponder);\n  }\n  // Negotiate with current responder\n  else {\n    const { onResponderTerminate, onResponderTerminationRequest } =\n      getResponderConfig(currentId);\n\n    let allowTransfer = true;\n    if (onResponderTerminationRequest != null) {\n      responderEvent.currentTarget = currentNode;\n      responderEvent.dispatchConfig.registrationName =\n        'onResponderTerminationRequest';\n      if (onResponderTerminationRequest(responderEvent) === false) {\n        allowTransfer = false;\n      }\n    }\n\n    if (allowTransfer) {\n      // Terminate existing responder\n      if (onResponderTerminate != null) {\n        responderEvent.currentTarget = currentNode;\n        responderEvent.dispatchConfig.registrationName = 'onResponderTerminate';\n        onResponderTerminate(responderEvent);\n      }\n      // Grant next responder\n      if (onResponderGrant != null) {\n        responderEvent.currentTarget = node;\n        responderEvent.dispatchConfig.registrationName = 'onResponderGrant';\n        onResponderGrant(responderEvent);\n      }\n      changeCurrentResponder(wantsResponder);\n    } else {\n      // Reject responder request\n      if (onResponderReject != null) {\n        responderEvent.currentTarget = node;\n        responderEvent.dispatchConfig.registrationName = 'onResponderReject';\n        onResponderReject(responderEvent);\n      }\n    }\n  }\n}\n\n/* ------------ PUBLIC API ------------ */\n\n/**\n * Attach Listeners\n *\n * Use native events as ReactDOM doesn't have a non-plugin API to implement\n * this system.\n */\nconst documentEventsCapturePhase = ['blur', 'scroll'];\nconst documentEventsBubblePhase = [\n  // mouse\n  'mousedown',\n  'mousemove',\n  'mouseup',\n  'dragstart',\n  // touch\n  'touchstart',\n  'touchmove',\n  'touchend',\n  'touchcancel',\n  // other\n  'contextmenu',\n  'select',\n  'selectionchange'\n];\nexport function attachListeners() {\n  if (canUseDOM && window.__reactResponderSystemActive == null) {\n    window.addEventListener('blur', eventListener);\n    documentEventsBubblePhase.forEach((eventType) => {\n      document.addEventListener(eventType, eventListener);\n    });\n    documentEventsCapturePhase.forEach((eventType) => {\n      document.addEventListener(eventType, eventListener, true);\n    });\n    window.__reactResponderSystemActive = true;\n  }\n}\n\n/**\n * Register a node with the ResponderSystem.\n */\nexport function addNode(id: ResponderId, node: any, config: ResponderConfig) {\n  setResponderId(node, id);\n  responderListenersMap.set(id, config);\n}\n\n/**\n * Unregister a node with the ResponderSystem.\n */\nexport function removeNode(id: ResponderId) {\n  if (currentResponder.id === id) {\n    terminateResponder();\n  }\n  if (responderListenersMap.has(id)) {\n    responderListenersMap.delete(id);\n  }\n}\n\n/**\n * Allow the current responder to be terminated from within components to support\n * more complex requirements, such as use with other React libraries for working\n * with scroll views, input views, etc.\n */\nexport function terminateResponder() {\n  const { id, node } = currentResponder;\n  if (id != null && node != null) {\n    const { onResponderTerminate } = getResponderConfig(id);\n    if (onResponderTerminate != null) {\n      const event = createResponderEvent({}, responderTouchHistoryStore);\n      event.currentTarget = node;\n      onResponderTerminate(event);\n    }\n    changeCurrentResponder(emptyResponder);\n  }\n  isEmulatingMouseEvents = false;\n  trackedTouchCount = 0;\n}\n\n/**\n * Allow unit tests to inspect the current responder in the system.\n * FOR TESTING ONLY.\n */\nexport function getResponderNode(): any {\n  return currentResponder.node;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useResponderEvents/ResponderTouchHistoryStore.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport type { Touch, TouchEvent } from './ResponderEventTypes';\nimport { isStartish, isMoveish, isEndish } from './ResponderEventTypes';\n\ntype TouchRecord = {|\n  currentPageX: number,\n  currentPageY: number,\n  currentTimeStamp: number,\n  previousPageX: number,\n  previousPageY: number,\n  previousTimeStamp: number,\n  startPageX: number,\n  startPageY: number,\n  startTimeStamp: number,\n  touchActive: boolean\n|};\n\nexport type TouchHistory = $ReadOnly<{|\n  indexOfSingleActiveTouch: number,\n  mostRecentTimeStamp: number,\n  numberActiveTouches: number,\n  touchBank: Array<TouchRecord>\n|}>;\n\n/**\n * Tracks the position and time of each active touch by `touch.identifier`. We\n * should typically only see IDs in the range of 1-20 because IDs get recycled\n * when touches end and start again.\n */\n\nconst __DEV__ = process.env.NODE_ENV !== 'production';\nconst MAX_TOUCH_BANK = 20;\n\nfunction timestampForTouch(touch: Touch): number {\n  // The legacy internal implementation provides \"timeStamp\", which has been\n  // renamed to \"timestamp\".\n  return (touch: any).timeStamp || touch.timestamp;\n}\n\n/**\n * TODO: Instead of making gestures recompute filtered velocity, we could\n * include a built in velocity computation that can be reused globally.\n */\nfunction createTouchRecord(touch: Touch): TouchRecord {\n  return {\n    touchActive: true,\n    startPageX: touch.pageX,\n    startPageY: touch.pageY,\n    startTimeStamp: timestampForTouch(touch),\n    currentPageX: touch.pageX,\n    currentPageY: touch.pageY,\n    currentTimeStamp: timestampForTouch(touch),\n    previousPageX: touch.pageX,\n    previousPageY: touch.pageY,\n    previousTimeStamp: timestampForTouch(touch)\n  };\n}\n\nfunction resetTouchRecord(touchRecord: TouchRecord, touch: Touch): void {\n  touchRecord.touchActive = true;\n  touchRecord.startPageX = touch.pageX;\n  touchRecord.startPageY = touch.pageY;\n  touchRecord.startTimeStamp = timestampForTouch(touch);\n  touchRecord.currentPageX = touch.pageX;\n  touchRecord.currentPageY = touch.pageY;\n  touchRecord.currentTimeStamp = timestampForTouch(touch);\n  touchRecord.previousPageX = touch.pageX;\n  touchRecord.previousPageY = touch.pageY;\n  touchRecord.previousTimeStamp = timestampForTouch(touch);\n}\n\nfunction getTouchIdentifier({ identifier }: Touch): number {\n  if (identifier == null) {\n    console.error('Touch object is missing identifier.');\n  }\n  if (__DEV__) {\n    if (identifier > MAX_TOUCH_BANK) {\n      console.error(\n        'Touch identifier %s is greater than maximum supported %s which causes ' +\n          'performance issues backfilling array locations for all of the indices.',\n        identifier,\n        MAX_TOUCH_BANK\n      );\n    }\n  }\n  return identifier;\n}\n\nfunction recordTouchStart(touch: Touch, touchHistory): void {\n  const identifier = getTouchIdentifier(touch);\n  const touchRecord = touchHistory.touchBank[identifier];\n  if (touchRecord) {\n    resetTouchRecord(touchRecord, touch);\n  } else {\n    touchHistory.touchBank[identifier] = createTouchRecord(touch);\n  }\n  touchHistory.mostRecentTimeStamp = timestampForTouch(touch);\n}\n\nfunction recordTouchMove(touch: Touch, touchHistory): void {\n  const touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)];\n  if (touchRecord) {\n    touchRecord.touchActive = true;\n    touchRecord.previousPageX = touchRecord.currentPageX;\n    touchRecord.previousPageY = touchRecord.currentPageY;\n    touchRecord.previousTimeStamp = touchRecord.currentTimeStamp;\n    touchRecord.currentPageX = touch.pageX;\n    touchRecord.currentPageY = touch.pageY;\n    touchRecord.currentTimeStamp = timestampForTouch(touch);\n    touchHistory.mostRecentTimeStamp = timestampForTouch(touch);\n  } else {\n    console.warn(\n      'Cannot record touch move without a touch start.\\n',\n      `Touch Move: ${printTouch(touch)}\\n`,\n      `Touch Bank: ${printTouchBank(touchHistory)}`\n    );\n  }\n}\n\nfunction recordTouchEnd(touch: Touch, touchHistory): void {\n  const touchRecord = touchHistory.touchBank[getTouchIdentifier(touch)];\n  if (touchRecord) {\n    touchRecord.touchActive = false;\n    touchRecord.previousPageX = touchRecord.currentPageX;\n    touchRecord.previousPageY = touchRecord.currentPageY;\n    touchRecord.previousTimeStamp = touchRecord.currentTimeStamp;\n    touchRecord.currentPageX = touch.pageX;\n    touchRecord.currentPageY = touch.pageY;\n    touchRecord.currentTimeStamp = timestampForTouch(touch);\n    touchHistory.mostRecentTimeStamp = timestampForTouch(touch);\n  } else {\n    console.warn(\n      'Cannot record touch end without a touch start.\\n',\n      `Touch End: ${printTouch(touch)}\\n`,\n      `Touch Bank: ${printTouchBank(touchHistory)}`\n    );\n  }\n}\n\nfunction printTouch(touch: Touch): string {\n  return JSON.stringify({\n    identifier: touch.identifier,\n    pageX: touch.pageX,\n    pageY: touch.pageY,\n    timestamp: timestampForTouch(touch)\n  });\n}\n\nfunction printTouchBank(touchHistory): string {\n  const { touchBank } = touchHistory;\n  let printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK));\n  if (touchBank.length > MAX_TOUCH_BANK) {\n    printed += ' (original size: ' + touchBank.length + ')';\n  }\n  return printed;\n}\n\nexport class ResponderTouchHistoryStore {\n  _touchHistory = {\n    touchBank: [], //Array<TouchRecord>\n    numberActiveTouches: 0,\n    // If there is only one active touch, we remember its location. This prevents\n    // us having to loop through all of the touches all the time in the most\n    // common case.\n    indexOfSingleActiveTouch: -1,\n    mostRecentTimeStamp: 0\n  };\n\n  recordTouchTrack(topLevelType: string, nativeEvent: TouchEvent): void {\n    const touchHistory = this._touchHistory;\n    if (isMoveish(topLevelType)) {\n      nativeEvent.changedTouches.forEach((touch) =>\n        recordTouchMove(touch, touchHistory)\n      );\n    } else if (isStartish(topLevelType)) {\n      nativeEvent.changedTouches.forEach((touch) =>\n        recordTouchStart(touch, touchHistory)\n      );\n      touchHistory.numberActiveTouches = nativeEvent.touches.length;\n      if (touchHistory.numberActiveTouches === 1) {\n        touchHistory.indexOfSingleActiveTouch =\n          nativeEvent.touches[0].identifier;\n      }\n    } else if (isEndish(topLevelType)) {\n      nativeEvent.changedTouches.forEach((touch) =>\n        recordTouchEnd(touch, touchHistory)\n      );\n      touchHistory.numberActiveTouches = nativeEvent.touches.length;\n      if (touchHistory.numberActiveTouches === 1) {\n        const { touchBank } = touchHistory;\n        for (let i = 0; i < touchBank.length; i++) {\n          const touchTrackToCheck = touchBank[i];\n          if (touchTrackToCheck != null && touchTrackToCheck.touchActive) {\n            touchHistory.indexOfSingleActiveTouch = i;\n            break;\n          }\n        }\n        if (__DEV__) {\n          const activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch];\n          if (!(activeRecord != null && activeRecord.touchActive)) {\n            console.error('Cannot find single active touch.');\n          }\n        }\n      }\n    }\n  }\n\n  get touchHistory(): TouchHistory {\n    return this._touchHistory;\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useResponderEvents/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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\nimport { act, render } from '@testing-library/react';\nimport React, { createRef } from 'react';\nimport useResponderEvents from '..';\nimport { getResponderNode, terminateResponder } from '../ResponderSystem';\nimport {\n  buttonType,\n  buttonsType,\n  clearPointers,\n  createEventTarget,\n  testWithPointerType\n} from 'dom-event-testing-library';\n\ndescribe('useResponderEvents', () => {\n  afterEach(() => {\n    // make sure all tests end with the current responder being reset\n    terminateResponder();\n    // make sure all tests reset state machine tracking pointers on the mock surface\n    clearPointers();\n  });\n\n  testWithPointerType(\n    'does nothing when no elements want to respond',\n    (pointerType) => {\n      const targetRef = createRef();\n      const Component = () => {\n        useResponderEvents(targetRef, {\n          onStartShouldSetResponder: jest.fn()\n        });\n        return <div ref={targetRef} />;\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      // gesture\n      act(() => {\n        target.pointerdown({ pointerType });\n      });\n      // no responder should be active\n      expect(getResponderNode()).toBe(null);\n    }\n  );\n\n  test('does nothing for \"mousedown\" with non-primary buttons', () => {\n    const targetRef = createRef();\n    const Component = () => {\n      useResponderEvents(targetRef, {\n        onStartShouldSetResponderCapture: jest.fn(() => true),\n        onStartShouldSetResponder: jest.fn(() => true)\n      });\n      return <div ref={targetRef} />;\n    };\n\n    // render\n    render(<Component />);\n    const target = createEventTarget(targetRef.current);\n    const buttons = [1, 2, 3, 4];\n    // gesture\n    act(() => {\n      buttons.forEach((button) => {\n        target.pointerdown({\n          pointerType: 'mouse',\n          button: buttonType.auxiliary,\n          buttons: buttonsType.auxiliary\n        });\n      });\n    });\n    expect(getResponderNode()).toBe(null);\n  });\n\n  test('does nothing for \"mousedown\" with ignored modifier keys', () => {\n    const targetRef = createRef();\n    const Component = () => {\n      useResponderEvents(targetRef, {\n        onStartShouldSetResponderCapture: jest.fn(() => true),\n        onStartShouldSetResponder: jest.fn(() => true)\n      });\n      return <div ref={targetRef} />;\n    };\n\n    // render\n    render(<Component />);\n    const target = createEventTarget(targetRef.current);\n    const acceptedModifierKeys = ['metaKey', 'shiftKey'];\n    const ignoredModifierKeys = ['altKey', 'ctrlKey'];\n    // gesture\n    act(() => {\n      ignoredModifierKeys.forEach((modifierKey) => {\n        target.pointerdown({ pointerType: 'mouse', [modifierKey]: true });\n      });\n    });\n    expect(getResponderNode()).toBe(null);\n    // gesture\n    act(() => {\n      acceptedModifierKeys.forEach((modifierKey) => {\n        target.pointerdown({ pointerType: 'mouse', [modifierKey]: true });\n      });\n    });\n    expect(getResponderNode()).not.toBe(null);\n  });\n\n  test('recognizes mouse interactions after touch interactions', () => {\n    const targetRef = createRef();\n    const targetCallbacks = {\n      onStartShouldSetResponder: jest.fn(() => true),\n      onResponderGrant: jest.fn()\n    };\n    const Component = () => {\n      useResponderEvents(targetRef, targetCallbacks);\n      return <div ref={targetRef} />;\n    };\n\n    // render\n    render(<Component />);\n    const target = createEventTarget(targetRef.current);\n    // touch gesture\n    act(() => {\n      target.pointerdown({ pointerType: 'touch' });\n      target.pointerup({ pointerType: 'touch' });\n    });\n    expect(targetCallbacks.onResponderGrant).toBeCalledTimes(1);\n    // mouse gesture\n    act(() => {\n      target.pointerdown({ pointerType: 'mouse' });\n      target.pointerup({ pointerType: 'mouse' });\n    });\n    expect(targetCallbacks.onResponderGrant).toBeCalledTimes(2);\n    // touch gesture with move\n    act(() => {\n      target.pointerdown({ pointerType: 'touch' });\n      target.pointermove({ pointerType: 'touch' });\n      target.pointerup({ pointerType: 'touch' });\n    });\n    expect(targetCallbacks.onResponderGrant).toBeCalledTimes(3);\n    // mouse gesture\n    act(() => {\n      target.pointerdown({ pointerType: 'mouse' });\n      target.pointerup({ pointerType: 'mouse' });\n    });\n    expect(targetCallbacks.onResponderGrant).toBeCalledTimes(4);\n  });\n\n  // NOTE: this is only needed for performance reasons while the\n  // `touchBank` is an array.\n  test('normalizes touch identifiers', () => {\n    const targetRef = createRef();\n    let identifier;\n    const Component = () => {\n      useResponderEvents(targetRef, {\n        onStartShouldSetResponder: () => true,\n        onResponderStart: jest.fn((e) => {\n          identifier = e.nativeEvent.identifier;\n        })\n      });\n      return <div ref={targetRef} />;\n    };\n\n    // render\n    render(<Component />);\n    const target = createEventTarget(targetRef.current);\n    // gesture\n    act(() => {\n      target.pointerdown({ pointerId: 123456, pointerType: 'touch' });\n    });\n    expect(identifier <= 20).toBe(true);\n  });\n\n  /**\n   * SET: onStartShouldSetResponderCapture\n   */\n\n  describe('onStartShouldSetResponderCapture', () => {\n    let grandParentRef;\n    let parentRef;\n    let targetRef;\n\n    beforeEach(() => {\n      grandParentRef = createRef();\n      parentRef = createRef();\n      targetRef = createRef();\n    });\n\n    testWithPointerType(\n      'start grants responder to grandParent',\n      (pointerType) => {\n        let grantCurrentTarget;\n        const grandParentCallbacks = {\n          onStartShouldSetResponderCapture: jest.fn((e) => {\n            return true;\n          }),\n          onResponderGrant: jest.fn((e) => {\n            grantCurrentTarget = e.currentTarget;\n          })\n        };\n        const parentCallbacks = {\n          onStartShouldSetResponderCapture: jest.fn(() => true)\n        };\n        const targetCallbacks = {\n          onStartShouldSetResponderCapture: jest.fn(() => true)\n        };\n\n        const Component = () => {\n          useResponderEvents(grandParentRef, grandParentCallbacks);\n          useResponderEvents(parentRef, parentCallbacks);\n          useResponderEvents(targetRef, targetCallbacks);\n          return (\n            <div ref={grandParentRef}>\n              <div ref={parentRef}>\n                <div ref={targetRef} />\n              </div>\n            </div>\n          );\n        };\n\n        // render\n        render(<Component />);\n        const target = createEventTarget(targetRef.current);\n        // gesture start\n        act(() => {\n          target.pointerdown({ pointerType });\n        });\n        // responder set (capture phase)\n        expect(\n          grandParentCallbacks.onStartShouldSetResponderCapture\n        ).toBeCalledTimes(1);\n        expect(\n          parentCallbacks.onStartShouldSetResponderCapture\n        ).not.toBeCalled();\n        expect(\n          targetCallbacks.onStartShouldSetResponderCapture\n        ).not.toBeCalled();\n        // responder grant\n        expect(getResponderNode()).toBe(grandParentRef.current);\n        expect(grandParentCallbacks.onResponderGrant).toBeCalledTimes(1);\n        expect(grantCurrentTarget).toBe(grandParentRef.current);\n        // gesture end\n        act(() => {\n          target.pointerup({ pointerType });\n        });\n        // no responder should be set\n        expect(getResponderNode()).toBe(null);\n      }\n    );\n\n    testWithPointerType('start grants responder to parent', (pointerType) => {\n      const grandParentCallbacks = {\n        onStartShouldSetResponderCapture: jest.fn(() => false)\n      };\n      const parentCallbacks = {\n        onStartShouldSetResponderCapture: jest.fn(() => true),\n        onResponderGrant: jest.fn()\n      };\n      const targetCallbacks = {\n        onStartShouldSetResponderCapture: jest.fn(() => true)\n      };\n\n      const Component = () => {\n        useResponderEvents(grandParentRef, grandParentCallbacks);\n        useResponderEvents(parentRef, parentCallbacks);\n        useResponderEvents(targetRef, targetCallbacks);\n        return (\n          <div ref={grandParentRef}>\n            <div ref={parentRef}>\n              <div ref={targetRef} />\n            </div>\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      // gesture start\n      act(() => {\n        target.pointerdown({ pointerType });\n      });\n      // responder set (capture phase)\n      expect(\n        grandParentCallbacks.onStartShouldSetResponderCapture\n      ).toBeCalledTimes(1);\n      expect(parentCallbacks.onStartShouldSetResponderCapture).toBeCalledTimes(\n        1\n      );\n      expect(targetCallbacks.onStartShouldSetResponderCapture).not.toBeCalled();\n      // responder grant\n      expect(getResponderNode()).toBe(parentRef.current);\n      expect(parentCallbacks.onResponderGrant).toBeCalledTimes(1);\n      // gesture end\n      act(() => {\n        target.pointerup({ pointerType });\n      });\n      // no responder should be set\n      expect(getResponderNode()).toBe(null);\n    });\n\n    testWithPointerType('start grants responder to child', (pointerType) => {\n      const grandParentCallbacks = {\n        onStartShouldSetResponderCapture: jest.fn(() => false)\n      };\n      const parentCallbacks = {\n        onStartShouldSetResponderCapture: jest.fn(() => false)\n      };\n      const targetCallbacks = {\n        onStartShouldSetResponderCapture: jest.fn(() => true),\n        onResponderGrant: jest.fn()\n      };\n\n      const Component = () => {\n        useResponderEvents(grandParentRef, grandParentCallbacks);\n        useResponderEvents(parentRef, parentCallbacks);\n        useResponderEvents(targetRef, targetCallbacks);\n        return (\n          <div ref={grandParentRef}>\n            <div ref={parentRef}>\n              <div ref={targetRef} />\n            </div>\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      // gesture start\n      act(() => {\n        target.pointerdown({ pointerType });\n      });\n      // responder set (capture phase)\n      expect(\n        grandParentCallbacks.onStartShouldSetResponderCapture\n      ).toBeCalledTimes(1);\n      expect(parentCallbacks.onStartShouldSetResponderCapture).toBeCalledTimes(\n        1\n      );\n      expect(targetCallbacks.onStartShouldSetResponderCapture).toBeCalledTimes(\n        1\n      );\n      // responder grant\n      expect(getResponderNode()).toBe(targetRef.current);\n      expect(targetCallbacks.onResponderGrant).toBeCalledTimes(1);\n      // gesture end\n      act(() => {\n        target.pointerup({ pointerType });\n      });\n      // no responder should be set\n      expect(getResponderNode()).toBe(null);\n    });\n  });\n\n  /**\n   * SET: onStartShouldSetResponder\n   */\n\n  describe('onStartShouldSetResponder', () => {\n    let targetRef;\n    let parentRef;\n    let grandParentRef;\n\n    beforeEach(() => {\n      targetRef = createRef();\n      parentRef = createRef();\n      grandParentRef = createRef();\n    });\n\n    testWithPointerType('start grants responder to child', (pointerType) => {\n      const targetCallbacks = {\n        onStartShouldSetResponder: jest.fn(() => true),\n        onResponderGrant: jest.fn()\n      };\n      const parentCallbacks = {\n        onStartShouldSetResponder: jest.fn(() => true)\n      };\n      const grandParentCallbacks = {\n        onStartShouldSetResponder: jest.fn(() => true)\n      };\n\n      const Component = () => {\n        useResponderEvents(grandParentRef, grandParentCallbacks);\n        useResponderEvents(parentRef, parentCallbacks);\n        useResponderEvents(targetRef, targetCallbacks);\n        return (\n          <div ref={grandParentRef}>\n            <div ref={parentRef}>\n              <div ref={targetRef} />\n            </div>\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      // gesture start\n      act(() => {\n        target.pointerdown({ pointerType });\n      });\n      // responder set (bubble phase)\n      expect(targetCallbacks.onStartShouldSetResponder).toBeCalledTimes(1);\n      expect(parentCallbacks.onStartShouldSetResponder).not.toBeCalled();\n      expect(grandParentCallbacks.onStartShouldSetResponder).not.toBeCalled();\n      // responder grant\n      expect(getResponderNode()).toBe(targetRef.current);\n      expect(targetCallbacks.onResponderGrant).toBeCalledTimes(1);\n      // gesture end\n      act(() => {\n        target.pointerup({ pointerType });\n      });\n      // no responder should be set\n      expect(getResponderNode()).toBe(null);\n    });\n\n    testWithPointerType('start grants responder to parent', (pointerType) => {\n      const targetCallbacks = {\n        onStartShouldSetResponder: jest.fn(() => false)\n      };\n      const parentCallbacks = {\n        onStartShouldSetResponder: jest.fn(() => true),\n        onResponderGrant: jest.fn()\n      };\n      const grandParentCallbacks = {\n        onStartShouldSetResponder: jest.fn(() => true)\n      };\n\n      const Component = () => {\n        useResponderEvents(grandParentRef, grandParentCallbacks);\n        useResponderEvents(parentRef, parentCallbacks);\n        useResponderEvents(targetRef, targetCallbacks);\n        return (\n          <div ref={grandParentRef}>\n            <div ref={parentRef}>\n              <div ref={targetRef} />\n            </div>\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      // gesture start\n      act(() => {\n        target.pointerdown({ pointerType });\n      });\n      // responder set (bubble phase)\n      expect(targetCallbacks.onStartShouldSetResponder).toBeCalledTimes(1);\n      expect(parentCallbacks.onStartShouldSetResponder).toBeCalledTimes(1);\n      expect(grandParentCallbacks.onStartShouldSetResponder).not.toBeCalled();\n      // responder grant\n      expect(getResponderNode()).toBe(parentRef.current);\n      expect(parentCallbacks.onResponderGrant).toBeCalledTimes(1);\n      // gesture end\n      act(() => {\n        target.pointerup({ pointerType });\n      });\n      // no responder should be set\n      expect(getResponderNode()).toBe(null);\n    });\n\n    testWithPointerType(\n      'start grants responder to grandParent',\n      (pointerType) => {\n        const targetCallbacks = {\n          onStartShouldSetResponder: jest.fn(() => false)\n        };\n        const parentCallbacks = {\n          onStartShouldSetResponder: jest.fn(() => false)\n        };\n        const grandParentCallbacks = {\n          onStartShouldSetResponder: jest.fn(() => true),\n          onResponderGrant: jest.fn()\n        };\n\n        const Component = () => {\n          useResponderEvents(grandParentRef, grandParentCallbacks);\n          useResponderEvents(parentRef, parentCallbacks);\n          useResponderEvents(targetRef, targetCallbacks);\n          return (\n            <div ref={grandParentRef}>\n              <div ref={parentRef}>\n                <div ref={targetRef} />\n              </div>\n            </div>\n          );\n        };\n\n        // render\n        render(<Component />);\n        const target = createEventTarget(targetRef.current);\n        // gesture start\n        act(() => {\n          target.pointerdown({ pointerType });\n        });\n        // responder set (bubble phase)\n        expect(targetCallbacks.onStartShouldSetResponder).toBeCalledTimes(1);\n        expect(parentCallbacks.onStartShouldSetResponder).toBeCalledTimes(1);\n        expect(grandParentCallbacks.onStartShouldSetResponder).toBeCalledTimes(\n          1\n        );\n        // responder grant\n        expect(getResponderNode()).toBe(grandParentRef.current);\n        expect(grandParentCallbacks.onResponderGrant).toBeCalledTimes(1);\n        // gesture end\n        act(() => {\n          target.pointerup({ pointerType });\n        });\n        // no responder should be set\n        expect(getResponderNode()).toBe(null);\n      }\n    );\n  });\n\n  /**\n   * SET: onMoveShouldSetResponderCapture\n   */\n\n  describe('onMoveShouldSetResponderCapture', () => {\n    let grandParentRef;\n    let parentRef;\n    let targetRef;\n\n    beforeEach(() => {\n      grandParentRef = createRef();\n      parentRef = createRef();\n      targetRef = createRef();\n    });\n\n    testWithPointerType(\n      'move grants responder to grandParent',\n      (pointerType) => {\n        const grandParentCallbacks = {\n          onMoveShouldSetResponderCapture: jest.fn(() => true),\n          onResponderGrant: jest.fn()\n        };\n        const parentCallbacks = {\n          onMoveShouldSetResponderCapture: jest.fn(() => true)\n        };\n        const targetCallbacks = {\n          onMoveShouldSetResponderCapture: jest.fn(() => true)\n        };\n\n        const Component = () => {\n          useResponderEvents(grandParentRef, grandParentCallbacks);\n          useResponderEvents(parentRef, parentCallbacks);\n          useResponderEvents(targetRef, targetCallbacks);\n          return (\n            <div ref={grandParentRef}>\n              <div ref={parentRef}>\n                <div ref={targetRef} />\n              </div>\n            </div>\n          );\n        };\n\n        // render\n        render(<Component />);\n        const target = createEventTarget(targetRef.current);\n        // gesture start & move\n        act(() => {\n          target.pointerdown({ pointerType });\n          target.pointermove({ pointerType });\n        });\n        // responder set (capture phase)\n        expect(\n          grandParentCallbacks.onMoveShouldSetResponderCapture\n        ).toBeCalledTimes(1);\n        expect(\n          parentCallbacks.onMoveShouldSetResponderCapture\n        ).not.toBeCalled();\n        expect(\n          targetCallbacks.onMoveShouldSetResponderCapture\n        ).not.toBeCalled();\n        // responder grant\n        expect(getResponderNode()).toBe(grandParentRef.current);\n        expect(grandParentCallbacks.onResponderGrant).toBeCalledTimes(1);\n        // gesture end\n        act(() => {\n          target.pointerup({ pointerType });\n        });\n        // no responder should be set\n        expect(getResponderNode()).toBe(null);\n      }\n    );\n\n    testWithPointerType('move grants responder to parent', (pointerType) => {\n      const grandParentCallbacks = {\n        onMoveShouldSetResponderCapture: jest.fn(() => false)\n      };\n      const parentCallbacks = {\n        onMoveShouldSetResponderCapture: jest.fn(() => true),\n        onResponderGrant: jest.fn()\n      };\n      const targetCallbacks = {\n        onMoveShouldSetResponderCapture: jest.fn(() => true)\n      };\n\n      const Component = () => {\n        useResponderEvents(grandParentRef, grandParentCallbacks);\n        useResponderEvents(parentRef, parentCallbacks);\n        useResponderEvents(targetRef, targetCallbacks);\n        return (\n          <div ref={grandParentRef}>\n            <div ref={parentRef}>\n              <div ref={targetRef} />\n            </div>\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      // gesture start & move\n      act(() => {\n        target.pointerdown({ pointerType });\n        target.pointermove({ pointerType });\n      });\n      // responder set (capture phase)\n      expect(\n        grandParentCallbacks.onMoveShouldSetResponderCapture\n      ).toBeCalledTimes(1);\n      expect(parentCallbacks.onMoveShouldSetResponderCapture).toBeCalledTimes(\n        1\n      );\n      expect(targetCallbacks.onMoveShouldSetResponderCapture).not.toBeCalled();\n      // responder grant\n      expect(getResponderNode()).toBe(parentRef.current);\n      expect(parentCallbacks.onResponderGrant).toBeCalledTimes(1);\n      // gesture end\n      act(() => {\n        target.pointerup({ pointerType });\n      });\n      // no responder should be set\n      expect(getResponderNode()).toBe(null);\n    });\n\n    testWithPointerType('move grants responder to child', (pointerType) => {\n      const grandParentCallbacks = {\n        onMoveShouldSetResponderCapture: jest.fn(() => false)\n      };\n      const parentCallbacks = {\n        onMoveShouldSetResponderCapture: jest.fn(() => false)\n      };\n      const targetCallbacks = {\n        onMoveShouldSetResponderCapture: jest.fn(() => true),\n        onResponderGrant: jest.fn()\n      };\n\n      const Component = () => {\n        useResponderEvents(grandParentRef, grandParentCallbacks);\n        useResponderEvents(parentRef, parentCallbacks);\n        useResponderEvents(targetRef, targetCallbacks);\n        return (\n          <div ref={grandParentRef}>\n            <div ref={parentRef}>\n              <div ref={targetRef} />\n            </div>\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      // gesture start & move\n      act(() => {\n        target.pointerdown({ pointerType });\n        target.pointermove({ pointerType });\n      });\n      // responder set (capture phase)\n      expect(\n        grandParentCallbacks.onMoveShouldSetResponderCapture\n      ).toBeCalledTimes(1);\n      expect(parentCallbacks.onMoveShouldSetResponderCapture).toBeCalledTimes(\n        1\n      );\n      expect(targetCallbacks.onMoveShouldSetResponderCapture).toBeCalledTimes(\n        1\n      );\n      // responder grant\n      expect(getResponderNode()).toBe(targetRef.current);\n      expect(targetCallbacks.onResponderGrant).toBeCalledTimes(1);\n      // gesture end\n      act(() => {\n        target.pointerup({ pointerType });\n      });\n      // no responder should be set\n      expect(getResponderNode()).toBe(null);\n    });\n  });\n\n  /**\n   * SET: onMoveShouldSetResponder\n   */\n\n  describe('onMoveShouldSetResponder', () => {\n    let targetRef;\n    let parentRef;\n    let grandParentRef;\n\n    beforeEach(() => {\n      targetRef = createRef();\n      parentRef = createRef();\n      grandParentRef = createRef();\n    });\n\n    testWithPointerType('move grants responder to child', (pointerType) => {\n      const targetCallbacks = {\n        onMoveShouldSetResponder: jest.fn(() => true),\n        onResponderGrant: jest.fn()\n      };\n      const parentCallbacks = {\n        onMoveShouldSetResponder: jest.fn(() => true)\n      };\n      const grandParentCallbacks = {\n        onMoveShouldSetResponder: jest.fn(() => true)\n      };\n\n      const Component = () => {\n        useResponderEvents(grandParentRef, grandParentCallbacks);\n        useResponderEvents(parentRef, parentCallbacks);\n        useResponderEvents(targetRef, targetCallbacks);\n        return (\n          <div ref={grandParentRef}>\n            <div ref={parentRef}>\n              <div ref={targetRef} />\n            </div>\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      // gesture start & move\n      act(() => {\n        target.pointerdown({ pointerType });\n        target.pointermove({ pointerType });\n      });\n      // responder set (bubble phase)\n      expect(targetCallbacks.onMoveShouldSetResponder).toBeCalledTimes(1);\n      expect(parentCallbacks.onMoveShouldSetResponder).not.toBeCalled();\n      expect(grandParentCallbacks.onMoveShouldSetResponder).not.toBeCalled();\n      // responder grant\n      expect(getResponderNode()).toBe(targetRef.current);\n      expect(targetCallbacks.onResponderGrant).toBeCalledTimes(1);\n      // gesture end\n      act(() => {\n        target.pointerup({ pointerType });\n      });\n      // no responder should be set\n      expect(getResponderNode()).toBe(null);\n    });\n\n    testWithPointerType('move grants responder to parent', (pointerType) => {\n      const targetCallbacks = {\n        onMoveShouldSetResponder: jest.fn(() => false)\n      };\n      const parentCallbacks = {\n        onMoveShouldSetResponder: jest.fn(() => true),\n        onResponderGrant: jest.fn()\n      };\n      const grandParentCallbacks = {\n        onMoveShouldSetResponder: jest.fn(() => true)\n      };\n\n      const Component = () => {\n        useResponderEvents(grandParentRef, grandParentCallbacks);\n        useResponderEvents(parentRef, parentCallbacks);\n        useResponderEvents(targetRef, targetCallbacks);\n\n        return (\n          <div ref={grandParentRef}>\n            <div ref={parentRef}>\n              <div ref={targetRef} />\n            </div>\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      // gesture start & move\n      act(() => {\n        target.pointerdown({ pointerType });\n        target.pointermove({ pointerType });\n      });\n      // responder set (bubble phase)\n      expect(targetCallbacks.onMoveShouldSetResponder).toBeCalledTimes(1);\n      expect(parentCallbacks.onMoveShouldSetResponder).toBeCalledTimes(1);\n      expect(grandParentCallbacks.onMoveShouldSetResponder).not.toBeCalled();\n      // responder grant\n      expect(getResponderNode()).toBe(parentRef.current);\n      expect(parentCallbacks.onResponderGrant).toBeCalledTimes(1);\n      // gesture end\n      act(() => {\n        target.pointerup({ pointerType });\n      });\n      // no responder should be set\n      expect(getResponderNode()).toBe(null);\n    });\n\n    testWithPointerType(\n      'move grants responder to grandParent',\n      (pointerType) => {\n        const targetCallbacks = {\n          onMoveShouldSetResponder: jest.fn(() => false)\n        };\n        const parentCallbacks = {\n          onMoveShouldSetResponder: jest.fn(() => false)\n        };\n        const grandParentCallbacks = {\n          onMoveShouldSetResponder: jest.fn(() => true),\n          onResponderGrant: jest.fn()\n        };\n\n        const Component = () => {\n          useResponderEvents(grandParentRef, grandParentCallbacks);\n          useResponderEvents(parentRef, parentCallbacks);\n          useResponderEvents(targetRef, targetCallbacks);\n          return (\n            <div ref={grandParentRef}>\n              <div ref={parentRef}>\n                <div ref={targetRef} />\n              </div>\n            </div>\n          );\n        };\n\n        // render\n        render(<Component />);\n        const target = createEventTarget(targetRef.current);\n        // gesture start & move\n        act(() => {\n          target.pointerdown({ pointerType });\n          target.pointermove({ pointerType });\n        });\n        // responder set (bubble phase)\n        expect(targetCallbacks.onMoveShouldSetResponder).toBeCalled();\n        expect(parentCallbacks.onMoveShouldSetResponder).toBeCalled();\n        expect(grandParentCallbacks.onMoveShouldSetResponder).toBeCalled();\n        // responder grant\n        expect(getResponderNode()).toBe(grandParentRef.current);\n        expect(grandParentCallbacks.onResponderGrant).toBeCalledTimes(1);\n        // gesture end\n        act(() => {\n          target.pointerup({ pointerType });\n        });\n        // no responder should be set\n        expect(getResponderNode()).toBe(null);\n      }\n    );\n  });\n\n  /**\n   * SET: onScrollShouldSetResponderCapture\n   */\n\n  describe('onScrollShouldSetResponderCapture', () => {\n    let targetRef;\n    let parentRef;\n\n    beforeEach(() => {\n      targetRef = createRef();\n      parentRef = createRef();\n    });\n\n    testWithPointerType(\n      'scroll grants responder to parent if a pointer is down',\n      (pointerType) => {\n        const parentCallbacks = {\n          onScrollShouldSetResponderCapture: jest.fn(() => true),\n          onResponderGrant: jest.fn()\n        };\n        const targetCallbacks = {\n          onScrollShouldSetResponderCapture: jest.fn(() => false)\n        };\n\n        const Component = () => {\n          useResponderEvents(parentRef, parentCallbacks);\n          useResponderEvents(targetRef, targetCallbacks);\n          return (\n            <div ref={parentRef}>\n              <div ref={targetRef} />\n            </div>\n          );\n        };\n\n        // render\n        render(<Component />);\n        const target = createEventTarget(targetRef.current);\n        // gesture start\n        act(() => {\n          target.pointerdown({ pointerType });\n          target.scroll();\n        });\n        // responder set (capture phase)\n        expect(\n          parentCallbacks.onScrollShouldSetResponderCapture\n        ).toBeCalledTimes(1);\n        expect(\n          targetCallbacks.onScrollShouldSetResponderCapture\n        ).toBeCalledTimes(0);\n        // responder grant\n        expect(getResponderNode()).toBe(parentRef.current);\n        expect(parentCallbacks.onResponderGrant).toBeCalledTimes(1);\n      }\n    );\n\n    testWithPointerType(\n      'scroll grants responder to target if a pointer is down',\n      (pointerType) => {\n        const parentCallbacks = {\n          onScrollShouldSetResponderCapture: jest.fn(() => false)\n        };\n        const targetCallbacks = {\n          onScrollShouldSetResponderCapture: jest.fn(() => true),\n          onResponderGrant: jest.fn()\n        };\n\n        const Component = () => {\n          useResponderEvents(parentRef, parentCallbacks);\n          useResponderEvents(targetRef, targetCallbacks);\n          return (\n            <div ref={parentRef}>\n              <div ref={targetRef} />\n            </div>\n          );\n        };\n\n        // render\n        render(<Component />);\n        const target = createEventTarget(targetRef.current);\n        // gesture start\n        act(() => {\n          target.pointerdown({ pointerType });\n          target.scroll();\n        });\n        // responder set (capture phase)\n        expect(\n          parentCallbacks.onScrollShouldSetResponderCapture\n        ).toBeCalledTimes(1);\n        expect(\n          targetCallbacks.onScrollShouldSetResponderCapture\n        ).toBeCalledTimes(1);\n        // responder grant\n        expect(getResponderNode()).toBe(targetRef.current);\n        expect(targetCallbacks.onResponderGrant).toBeCalledTimes(1);\n      }\n    );\n  });\n\n  /**\n   * SET: onScrollShouldSetResponder\n   */\n\n  describe('onScrollShouldSetResponder', () => {\n    let targetRef;\n    let parentRef;\n\n    beforeEach(() => {\n      targetRef = createRef();\n      parentRef = createRef();\n    });\n\n    test('scroll does not bubble to parent', () => {\n      const parentCallbacks = {\n        onScrollShouldSetResponder: jest.fn(() => true)\n      };\n\n      const Component = () => {\n        useResponderEvents(parentRef, parentCallbacks);\n        return (\n          <div ref={parentRef}>\n            <div ref={targetRef} />\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      // gesture start\n      act(() => {\n        target.pointerdown();\n        target.scroll();\n      });\n      // no bubble\n      expect(parentCallbacks.onScrollShouldSetResponder).toBeCalledTimes(0);\n      expect(getResponderNode()).toBe(null);\n    });\n\n    testWithPointerType(\n      'scroll grants responder to target if a pointer is down',\n      (pointerType) => {\n        const targetCallbacks = {\n          onScrollShouldSetResponder: jest.fn(() => true),\n          onResponderGrant: jest.fn(),\n          onResponderRelease: jest.fn()\n        };\n\n        const Component = () => {\n          useResponderEvents(targetRef, targetCallbacks);\n          return <div ref={targetRef} />;\n        };\n\n        // render\n        render(<Component />);\n        const target = createEventTarget(targetRef.current);\n        // gesture start\n        act(() => {\n          target.pointerdown({ pointerType });\n          target.scroll();\n          target.scroll();\n        });\n        // responder set (bubble phase)\n        expect(targetCallbacks.onScrollShouldSetResponder).toBeCalledTimes(1);\n        // responder grant\n        expect(getResponderNode()).toBe(targetRef.current);\n        expect(targetCallbacks.onResponderGrant).toBeCalledTimes(1);\n        // gesture end\n        act(() => {\n          target.pointerup({ pointerType });\n        });\n        // make sure release is called\n        expect(getResponderNode()).toBe(null);\n        expect(targetCallbacks.onResponderRelease).toBeCalledTimes(1);\n      }\n    );\n  });\n\n  /**\n   * SET: onSelectionChangeShouldSetResponderCapture\n   * Not implemented. Expected behevior is not clear. Always terminate the responder\n   * and let the native system take over.\n   */\n\n  describe.skip('onSelectionChangeShouldSetResponderCapture', () => {});\n\n  /**\n   * SET: onSelectionChangeShouldSetResponder\n   * Not implemented. Expected behevior is not clear. Always terminate the responder\n   * and let the native system take over.\n   */\n\n  describe.skip('onSelectionChangeShouldSetResponder', () => {});\n\n  /**\n   * onResponderStart\n   */\n\n  describe('onResponderStart', () => {\n    let targetRef;\n\n    beforeEach(() => {\n      targetRef = createRef();\n    });\n\n    testWithPointerType(\n      'is called after \"start\" event on the view that became the responder',\n      (pointerType) => {\n        const targetCallbacks = {\n          onStartShouldSetResponder: jest.fn(() => true),\n          onResponderStart: jest.fn()\n        };\n\n        const Component = () => {\n          useResponderEvents(targetRef, targetCallbacks);\n          return <div ref={targetRef} />;\n        };\n\n        // render\n        render(<Component />);\n        const target = createEventTarget(targetRef.current);\n        // gesture start\n        act(() => {\n          target.pointerdown({ pointerType });\n        });\n        // responder start\n        expect(targetCallbacks.onResponderStart).toBeCalledTimes(1);\n        expect(targetCallbacks.onResponderStart).toBeCalledWith(\n          expect.objectContaining({\n            currentTarget: targetRef.current\n          })\n        );\n      }\n    );\n  });\n\n  /**\n   * onResponderMove\n   */\n\n  describe('onResponderMove', () => {\n    let targetRef;\n\n    beforeEach(() => {\n      targetRef = createRef();\n    });\n\n    // Assert that 'onResponderMove' after a move event, is called however the responder became active\n    ['onStartShouldSetResponder', 'onMoveShouldSetResponder'].forEach(\n      (shouldSetResponder) => {\n        testWithPointerType(\n          `is called after \"move\" event on responder (${shouldSetResponder})`,\n          (pointerType) => {\n            const targetCallbacks = {\n              [shouldSetResponder]: jest.fn(() => true),\n              onResponderMove: jest.fn()\n            };\n\n            const Component = () => {\n              useResponderEvents(targetRef, targetCallbacks);\n              return <div ref={targetRef} />;\n            };\n\n            // render\n            render(<Component />);\n            const target = createEventTarget(targetRef.current);\n            // gesture start & move\n            act(() => {\n              target.pointerdown({ pointerType });\n              target.pointermove({ pointerType });\n            });\n            // responder move\n            expect(targetCallbacks.onResponderMove).toBeCalledTimes(1);\n            expect(targetCallbacks.onResponderMove).toBeCalledWith(\n              expect.objectContaining({\n                currentTarget: targetRef.current\n              })\n            );\n          }\n        );\n      }\n    );\n  });\n\n  /**\n   * onResponderEnd\n   */\n\n  describe('onResponderEnd', () => {\n    let targetRef;\n\n    beforeEach(() => {\n      targetRef = createRef();\n    });\n\n    testWithPointerType(\n      'is called after \"end\" event on responder',\n      (pointerType) => {\n        const targetCallbacks = {\n          onStartShouldSetResponder: jest.fn(() => true),\n          onResponderEnd: jest.fn()\n        };\n\n        const Component = () => {\n          useResponderEvents(targetRef, targetCallbacks);\n          return <div ref={targetRef} />;\n        };\n\n        // render\n        render(<Component />);\n        const target = createEventTarget(targetRef.current);\n        // gesture start & end\n        act(() => {\n          target.pointerdown({ pointerType });\n          target.pointerup({ pointerType });\n        });\n        // responder end\n        expect(targetCallbacks.onResponderEnd).toBeCalledTimes(1);\n        expect(targetCallbacks.onResponderEnd).toBeCalledWith(\n          expect.objectContaining({\n            currentTarget: targetRef.current\n          })\n        );\n      }\n    );\n  });\n\n  /**\n   * onResponderRelease\n   */\n\n  describe('onResponderRelease', () => {\n    let targetRef;\n\n    beforeEach(() => {\n      targetRef = createRef();\n    });\n\n    testWithPointerType(\n      'is called after all touches with responder end',\n      (pointerType) => {\n        const targetCallbacks = {\n          onStartShouldSetResponder: jest.fn(() => true),\n          onResponderRelease: jest.fn()\n        };\n\n        const Component = () => {\n          useResponderEvents(targetRef, targetCallbacks);\n          return <div ref={targetRef} />;\n        };\n\n        // render\n        render(<Component />);\n        const target = createEventTarget(targetRef.current);\n        // gesture\n        act(() => {\n          target.pointerdown({ pointerType, pointerId: 1 });\n          target.pointerdown({ pointerType, pointerId: 2 });\n          target.pointerup({ pointerType, pointerId: 2 });\n          target.pointerup({ pointerType, pointerId: 1 });\n        });\n        // responder release\n        expect(targetCallbacks.onResponderRelease).toBeCalledTimes(1);\n        expect(targetCallbacks.onResponderRelease).toBeCalledWith(\n          expect.objectContaining({\n            currentTarget: targetRef.current\n          })\n        );\n      }\n    );\n  });\n\n  /**\n   * onResponderTerminate\n   */\n\n  describe('onResponderTerminate', () => {\n    let targetRef;\n\n    beforeEach(() => {\n      targetRef = createRef();\n    });\n\n    testWithPointerType('is called if pointer cancels', (pointerType) => {\n      const targetCallbacks = {\n        onStartShouldSetResponder: jest.fn(() => true),\n        onResponderEnd: jest.fn(),\n        onResponderTerminate: jest.fn(),\n        onResponderTerminationRequest: jest.fn(() => false)\n      };\n\n      const Component = () => {\n        useResponderEvents(targetRef, targetCallbacks);\n        return <div ref={targetRef} />;\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      // gesture start & cancel\n      act(() => {\n        target.pointerdown({ pointerType });\n        target.pointercancel({ pointerType });\n      });\n      // responder terminates\n      expect(targetCallbacks.onResponderEnd).toBeCalledTimes(1);\n      expect(targetCallbacks.onResponderTerminate).toBeCalledTimes(1);\n      expect(targetCallbacks.onResponderTerminate).toBeCalledWith(\n        expect.objectContaining({\n          currentTarget: targetRef.current\n        })\n      );\n    });\n\n    testWithPointerType('is called if input \"select\" occurs', (pointerType) => {\n      const targetCallbacks = {\n        onStartShouldSetResponder: jest.fn(() => true),\n        onResponderTerminate: jest.fn(),\n        onResponderTerminationRequest: jest.fn(() => false)\n      };\n\n      const inputRef = createRef();\n\n      const Component = () => {\n        useResponderEvents(targetRef, targetCallbacks);\n        return (\n          <div>\n            <div ref={targetRef} />\n            <input ref={inputRef} />\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      const input = createEventTarget(inputRef.current);\n      // getSelection is not supported in jest\n      act(() => {\n        target.pointerdown({ pointerType });\n        input.select({});\n      });\n      // responder terminates\n      expect(targetCallbacks.onResponderTerminate).toBeCalledTimes(1);\n      // responder should not be set\n      expect(getResponderNode()).toBe(null);\n    });\n\n    testWithPointerType(\n      'is called if \"selectionchange\" occurs',\n      (pointerType) => {\n        const targetCallbacks = {\n          onStartShouldSetResponder: jest.fn(() => true),\n          onResponderTerminate: jest.fn()\n        };\n\n        const Component = () => {\n          useResponderEvents(targetRef, targetCallbacks);\n          return <div ref={targetRef}>text selection test</div>;\n        };\n\n        // render\n        render(<Component />);\n        const target = createEventTarget(targetRef.current);\n        const doc = createEventTarget(document);\n        // getSelection is not supported in jest\n        window.getSelection = jest.fn(() => {\n          const node = targetRef.current;\n          const anchorNode =\n            node != null && node.firstChild != null ? node.firstChild : node;\n          return {\n            anchorNode,\n            toString() {\n              return 'text';\n            }\n          };\n        });\n        act(() => {\n          target.pointerdown({ pointerType });\n          target.pointermove({ pointerType });\n          doc.selectionchange({});\n        });\n        // responder terminates\n        expect(targetCallbacks.onResponderTerminate).toBeCalledTimes(1);\n        // responder should not be set\n        expect(getResponderNode()).toBe(null);\n      }\n    );\n\n    test('is called if ancestor scrolls', () => {\n      const pointerType = 'touch';\n      const parentRef = createRef();\n\n      const targetCallbacks = {\n        onStartShouldSetResponder: jest.fn(() => true),\n        onResponderTerminate: jest.fn()\n      };\n\n      const Component = () => {\n        useResponderEvents(targetRef, targetCallbacks);\n        return (\n          <div ref={parentRef}>\n            <div ref={targetRef} />\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      const parent = createEventTarget(parentRef.current);\n      // gesture start & scroll\n      act(() => {\n        target.pointerdown({ pointerType });\n        // ancestor scrolls\n        parent.scroll();\n      });\n      // responder terminates\n      expect(targetCallbacks.onResponderTerminate).toBeCalledTimes(1);\n      // no responder should be set\n      expect(getResponderNode()).toBe(null);\n    });\n\n    test('is called if document scrolls', () => {\n      const pointerType = 'touch';\n      const parentRef = createRef();\n\n      const targetCallbacks = {\n        onStartShouldSetResponder: jest.fn(() => true),\n        onResponderTerminate: jest.fn()\n      };\n\n      const Component = () => {\n        useResponderEvents(targetRef, targetCallbacks);\n        return (\n          <div ref={parentRef}>\n            <div ref={targetRef} />\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      const doc = createEventTarget(document);\n      // gesture start & scroll\n      act(() => {\n        target.pointerdown({ pointerType });\n        // document scrolls\n        doc.scroll();\n      });\n      // responder end\n      expect(targetCallbacks.onResponderTerminate).toBeCalledTimes(1);\n      // no responder should be set\n      expect(getResponderNode()).toBe(null);\n    });\n\n    test('is not called if sibling scrolls', () => {\n      const pointerType = 'touch';\n      const siblingRef = createRef();\n\n      const targetCallbacks = {\n        onStartShouldSetResponder: jest.fn(() => true),\n        onResponderTerminate: jest.fn()\n      };\n\n      const Component = () => {\n        useResponderEvents(targetRef, targetCallbacks);\n        return (\n          <div>\n            <div ref={targetRef} />\n            <div ref={siblingRef} />\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      const sibling = createEventTarget(siblingRef.current);\n      // gesture start & scroll\n      act(() => {\n        target.pointerdown({ pointerType });\n        // sibling scrolls\n        sibling.scroll();\n      });\n      // responder doesn't terminate\n      expect(targetCallbacks.onResponderTerminate).not.toBeCalled();\n      // responder should still be set\n      expect(getResponderNode()).toBe(targetRef.current);\n    });\n\n    test('is called if responder blurs', () => {\n      const pointerType = 'touch';\n      const targetCallbacks = {\n        onStartShouldSetResponder: jest.fn(() => true),\n        onResponderTerminate: jest.fn(),\n        onResponderTerminationRequest: jest.fn(() => false)\n      };\n\n      const Component = () => {\n        useResponderEvents(targetRef, targetCallbacks);\n        return <div ref={targetRef} />;\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      const doc = createEventTarget(document);\n      // gesture start & blur\n      act(() => {\n        target.pointerdown({ pointerType });\n        doc.focus({ relatedTarget: target.node });\n      });\n      // responder terminates\n      expect(targetCallbacks.onResponderTerminate).toBeCalledTimes(1);\n      // responder should still be set\n      expect(getResponderNode()).toBe(null);\n    });\n\n    test('is called if window blurs', () => {\n      const pointerType = 'touch';\n      const targetCallbacks = {\n        onStartShouldSetResponder: jest.fn(() => true),\n        onResponderTerminate: jest.fn(),\n        onResponderTerminationRequest: jest.fn(() => false)\n      };\n\n      const Component = () => {\n        useResponderEvents(targetRef, targetCallbacks);\n        return <div ref={targetRef} />;\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      const win = createEventTarget(window);\n      // gesture start & blur\n      act(() => {\n        target.pointerdown({ pointerType });\n        win.blur({ relatedTarget: target.node });\n      });\n      // responder terminates\n      expect(targetCallbacks.onResponderTerminate).toBeCalledTimes(1);\n      // responder should not be set\n      expect(getResponderNode()).toBe(null);\n    });\n\n    test('is not called if sibling blurs', () => {\n      const pointerType = 'touch';\n      const siblingRef = createRef();\n\n      const targetCallbacks = {\n        onStartShouldSetResponder: jest.fn(() => true),\n        onResponderTerminate: jest.fn()\n      };\n\n      const Component = () => {\n        useResponderEvents(targetRef, targetCallbacks);\n        return (\n          <div>\n            <div ref={targetRef} />\n            <div ref={siblingRef} />\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      const sibling = createEventTarget(siblingRef.current);\n      // gesture start & blur\n      act(() => {\n        target.pointerdown({ pointerType });\n        // sibling blurs\n        sibling.blur({ relatedTarget: target.node });\n      });\n      // responder doesn't terminate\n      expect(targetCallbacks.onResponderTerminate).not.toBeCalled();\n      // responder should still be set\n      expect(getResponderNode()).toBe(targetRef.current);\n    });\n\n    test('is called if contextmenu opens', () => {\n      // only test 'touch' because nothing can become the responder\n      // when using mouse right-click to open a context menu\n      const pointerType = 'touch';\n      const targetCallbacks = {\n        onStartShouldSetResponder: jest.fn(() => true),\n        onResponderTerminate: jest.fn(),\n        onResponderTerminationRequest: jest.fn()\n      };\n\n      const Component = () => {\n        useResponderEvents(targetRef, targetCallbacks);\n        return <div ref={targetRef} />;\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      // contextmenu sequence includes pointerdown \"start\"\n      act(() => {\n        target.contextmenu({ pointerType });\n      });\n      // responder terminates\n      expect(targetCallbacks.onResponderTerminate).toBeCalledTimes(1);\n      // responder should not be set\n      expect(getResponderNode()).toBe(null);\n    });\n\n    test('can be denied for \"contextmenu\", \"scroll\", and \"selectionchange\" events', () => {\n      const targetCallbacks = {\n        onStartShouldSetResponder: jest.fn(() => true),\n        onResponderTerminate: jest.fn(),\n        onResponderTerminationRequest: jest.fn(() => false)\n      };\n\n      const Component = () => {\n        useResponderEvents(targetRef, targetCallbacks);\n        return <div ref={targetRef} />;\n      };\n\n      function assertAndCleanUp() {\n        expect(targetCallbacks.onResponderTerminate).toBeCalledTimes(0);\n        expect(getResponderNode()).toBe(targetRef.current);\n        terminateResponder();\n        clearPointers();\n        targetCallbacks.onResponderTerminate.mockClear();\n      }\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      const doc = createEventTarget(document);\n      // contextmenu\n      act(() => {\n        target.contextmenu({ pointerType: 'touch' });\n      });\n      assertAndCleanUp();\n      // scroll\n      act(() => {\n        target.pointerdown({ pointerType: 'touch' });\n        doc.scroll();\n      });\n      assertAndCleanUp();\n      // selectionchange\n      act(() => {\n        target.pointerdown({ pointerType: 'mouse' });\n        doc.selectionchange({});\n      });\n      assertAndCleanUp();\n    });\n  });\n\n  /**\n   * Negotiation of responder from common ancestor\n   */\n\n  describe('Negotiation', () => {\n    let grandParentRef;\n    let parentRef;\n    let siblingRef;\n    let targetRef;\n\n    beforeEach(() => {\n      grandParentRef = createRef();\n      parentRef = createRef();\n      siblingRef = createRef();\n      targetRef = createRef();\n    });\n\n    /**\n     * When there is an active responder, negotiation of the active pointer captures to\n     * and bubbles from the closest common ancestor registered with the system. The\n     * responder is transferred and maintained for subsequent events of the same type.\n     */\n    test('negotiates single-touch from first registered ancestor of responder and transfers', () => {\n      const pointerType = 'touch';\n      const eventLog = [];\n      const grandParentCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('grandParent: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('grandParent: onStartShouldSetResponder');\n          return false;\n        },\n        onMoveShouldSetResponderCapture() {\n          eventLog.push('grandParent: onMoveShouldSetResponderCapture');\n          return false;\n        },\n        onMoveShouldSetResponder() {\n          eventLog.push('grandParent: onMoveShouldSetResponder');\n          return true;\n        },\n        onResponderGrant() {\n          eventLog.push('grandParent: onResponderGrant');\n        },\n        onResponderStart() {\n          eventLog.push('grandParent: onResponderStart');\n        },\n        onResponderMove() {\n          eventLog.push('grandParent: onResponderMove');\n        },\n        onResponderEnd() {\n          eventLog.push('grandParent: onResponderEnd');\n        },\n        onResponderRelease() {\n          eventLog.push('grandParent: onResponderRelease');\n        },\n        onResponderTerminate() {\n          eventLog.push('grandParent: onResponderTerminate');\n        },\n        onResponderTerminationRequest() {\n          eventLog.push('grandParent: onResponderTerminationRequest');\n          return true;\n        }\n      };\n      const parentCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('parent: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('parent: onStartShouldSetResponder');\n          return false;\n        },\n        onMoveShouldSetResponderCapture() {\n          eventLog.push('parent: onMoveShouldSetResponderCapture');\n          return false;\n        },\n        onMoveShouldSetResponder() {\n          eventLog.push('parent: onMoveShouldSetResponder');\n          return false;\n        },\n        onResponderGrant() {\n          eventLog.push('parent: onResponderGrant');\n        },\n        onResponderStart() {\n          eventLog.push('parent: onResponderStart');\n        },\n        onResponderMove() {\n          eventLog.push('parent: onResponderMove');\n        },\n        onResponderEnd() {\n          eventLog.push('parent: onResponderEnd');\n        },\n        onResponderRelease() {\n          eventLog.push('parent: onResponderRelease');\n        },\n        onResponderTerminate() {\n          eventLog.push('parent: onResponderTerminate');\n        },\n        onResponderTerminationRequest() {\n          eventLog.push('parent: onResponderTerminationRequest');\n          return true;\n        }\n      };\n      const targetCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('target: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('target: onStartShouldSetResponder');\n          return true;\n        },\n        onMoveShouldSetResponderCapture() {\n          eventLog.push('target: onMoveShouldSetResponderCapture');\n          return false;\n        },\n        onMoveShouldSetResponder() {\n          eventLog.push('target: onMoveShouldSetResponder');\n          return false;\n        },\n        onResponderGrant() {\n          eventLog.push('target: onResponderGrant');\n        },\n        onResponderStart() {\n          eventLog.push('target: onResponderStart');\n        },\n        onResponderMove() {\n          eventLog.push('target: onResponderMove');\n        },\n        onResponderEnd() {\n          eventLog.push('target: onResponderEnd');\n        },\n        onResponderRelease() {\n          eventLog.push('target: onResponderRelease');\n        },\n        onResponderTerminate() {\n          eventLog.push('target: onResponderTerminate');\n        },\n        onResponderTerminationRequest() {\n          eventLog.push('target: onResponderTerminationRequest');\n          return true;\n        }\n      };\n\n      const Component = () => {\n        useResponderEvents(grandParentRef, grandParentCallbacks);\n        useResponderEvents(parentRef, parentCallbacks);\n        useResponderEvents(targetRef, targetCallbacks);\n        return (\n          <div ref={grandParentRef}>\n            <div ref={parentRef}>\n              <div ref={targetRef} />\n            </div>\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n\n      // gesture start\n      act(() => {\n        target.pointerdown({ pointerType, pointerId: 1 });\n        target.pointermove({ pointerType, pointerId: 1 });\n        target.pointermove({ pointerType, pointerId: 1 });\n      });\n      expect(eventLog).toEqual([\n        'grandParent: onStartShouldSetResponderCapture',\n        'parent: onStartShouldSetResponderCapture',\n        'target: onStartShouldSetResponderCapture',\n        'target: onStartShouldSetResponder',\n        'target: onResponderGrant',\n        'target: onResponderStart',\n        'grandParent: onMoveShouldSetResponderCapture',\n        'parent: onMoveShouldSetResponderCapture',\n        'parent: onMoveShouldSetResponder',\n        'grandParent: onMoveShouldSetResponder',\n        'target: onResponderTerminationRequest',\n        'target: onResponderTerminate',\n        'grandParent: onResponderGrant',\n        'grandParent: onResponderMove',\n        // Continues calling 'move' rather than entering into negotiation again\n        'grandParent: onResponderMove'\n      ]);\n    });\n\n    /**\n     * When there is an active responder, negotiation of a second pointer captures to\n     * and bubbles from the closest common ancestor registered with the system. The\n     * responder is transferred andvthe relevant termination events are called.\n     */\n    test('negotiates multi-touch from first registered ancestor of responder and transfers', () => {\n      const pointerType = 'touch';\n      let eventLog = [];\n      const grandParentCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('grandParent: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('grandParent: onStartShouldSetResponder');\n          return false;\n        },\n        onMoveShouldSetResponderCapture() {\n          eventLog.push('grandParent: onMoveShouldSetResponderCapture');\n          return false;\n        },\n        onMoveShouldSetResponder() {\n          eventLog.push('grandParent: onMoveShouldSetResponder');\n          return true;\n        },\n        onResponderGrant() {\n          eventLog.push('grandParent: onResponderGrant');\n        },\n        onResponderStart() {\n          eventLog.push('grandParent: onResponderStart');\n        },\n        onResponderMove() {\n          eventLog.push('grandParent: onResponderMove');\n        },\n        onResponderEnd() {\n          eventLog.push('grandParent: onResponderEnd');\n        },\n        onResponderRelease() {\n          eventLog.push('grandParent: onResponderRelease');\n        },\n        onResponderTerminate() {\n          eventLog.push('grandParent: onResponderTerminate');\n        },\n        onResponderTerminationRequest() {\n          eventLog.push('grandParent: onResponderTerminationRequest');\n          return true;\n        }\n      };\n      const parentCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('parent: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('parent: onStartShouldSetResponder');\n          return false;\n        },\n        onMoveShouldSetResponderCapture() {\n          eventLog.push('parent: onMoveShouldSetResponderCapture');\n          return false;\n        },\n        onMoveShouldSetResponder() {\n          eventLog.push('parent: onMoveShouldSetResponder');\n          return true;\n        },\n        onResponderGrant() {\n          eventLog.push('parent: onResponderGrant');\n        },\n        onResponderStart() {\n          eventLog.push('parent: onResponderStart');\n        },\n        onResponderMove() {\n          eventLog.push('parent: onResponderMove');\n        },\n        onResponderEnd() {\n          eventLog.push('parent: onResponderEnd');\n        },\n        onResponderRelease() {\n          eventLog.push('parent: onResponderRelease');\n        },\n        onResponderTerminate() {\n          eventLog.push('parent: onResponderTerminate');\n        },\n        onResponderTerminationRequest() {\n          eventLog.push('parent: onResponderTerminationRequest');\n          return true;\n        }\n      };\n      const targetCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('target: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('target: onStartShouldSetResponder');\n          return true;\n        },\n        onMoveShouldSetResponderCapture() {\n          eventLog.push('target: onMoveShouldSetResponderCapture');\n          return false;\n        },\n        onMoveShouldSetResponder() {\n          eventLog.push('target: onMoveShouldSetResponder');\n          return false;\n        },\n        onResponderGrant() {\n          eventLog.push('target: onResponderGrant');\n        },\n        onResponderStart() {\n          eventLog.push('target: onResponderStart');\n        },\n        onResponderMove() {\n          eventLog.push('target: onResponderMove');\n        },\n        onResponderEnd() {\n          eventLog.push('target: onResponderEnd');\n        },\n        onResponderRelease() {\n          eventLog.push('target: onResponderRelease');\n        },\n        onResponderTerminate() {\n          eventLog.push('target: onResponderTerminate');\n        },\n        onResponderTerminationRequest() {\n          eventLog.push('target: onResponderTerminationRequest');\n          return true;\n        }\n      };\n\n      const Component = () => {\n        useResponderEvents(grandParentRef, grandParentCallbacks);\n        useResponderEvents(parentRef, parentCallbacks);\n        useResponderEvents(targetRef, targetCallbacks);\n        return (\n          <div ref={grandParentRef}>\n            <div ref={parentRef}>\n              <div ref={targetRef} />\n            </div>\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n\n      // gesture start\n      act(() => {\n        target.pointerdown({ pointerType, pointerId: 1 });\n      });\n      // target becomes responder\n      expect(getResponderNode()).toBe(targetRef.current);\n      expect(eventLog).toEqual([\n        'grandParent: onStartShouldSetResponderCapture',\n        'parent: onStartShouldSetResponderCapture',\n        'target: onStartShouldSetResponderCapture',\n        'target: onStartShouldSetResponder',\n        'target: onResponderGrant',\n        'target: onResponderStart'\n      ]);\n      eventLog = [];\n      // second gesture start\n      act(() => {\n        target.pointerdown({ pointerType, pointerId: 2 });\n      });\n      // target remains responder for start event\n      expect(getResponderNode()).toBe(targetRef.current);\n      expect(eventLog).toEqual([\n        'grandParent: onStartShouldSetResponderCapture',\n        'parent: onStartShouldSetResponderCapture',\n        'parent: onStartShouldSetResponder',\n        'grandParent: onStartShouldSetResponder',\n        'target: onResponderStart'\n      ]);\n      eventLog = [];\n      // first move gesture\n      act(() => {\n        target.pointermove({ pointerType, pointerId: 1 });\n      });\n      // parent becomes responder, target terminates\n      expect(getResponderNode()).toBe(parentRef.current);\n      expect(eventLog).toEqual([\n        'grandParent: onMoveShouldSetResponderCapture',\n        'parent: onMoveShouldSetResponderCapture',\n        'parent: onMoveShouldSetResponder',\n        'target: onResponderTerminationRequest',\n        'target: onResponderTerminate',\n        'parent: onResponderGrant',\n        'parent: onResponderMove'\n      ]);\n      eventLog = [];\n      // second move gesture\n      act(() => {\n        target.pointermove({ pointerType, pointerId: 1 });\n        target.pointermove({ pointerType, pointerId: 2 });\n      });\n      // grand parent becomes responder, parent terminates\n      expect(getResponderNode()).toBe(grandParentRef.current);\n      expect(eventLog).toEqual([\n        'grandParent: onMoveShouldSetResponderCapture',\n        'grandParent: onMoveShouldSetResponder',\n        'parent: onResponderTerminationRequest',\n        'parent: onResponderTerminate',\n        'grandParent: onResponderGrant',\n        'grandParent: onResponderMove',\n        'grandParent: onResponderMove'\n      ]);\n      eventLog = [];\n      // end gestures\n      act(() => {\n        target.pointerup({ pointerType, pointerId: 2 });\n        target.pointerup({ pointerType, pointerId: 1 });\n      });\n      expect(getResponderNode()).toBe(null);\n      expect(eventLog).toEqual([\n        'grandParent: onResponderEnd',\n        'grandParent: onResponderEnd',\n        'grandParent: onResponderRelease'\n      ]);\n    });\n\n    /**\n     * If nothing is responder, then the negotiation should propagate directly to\n     * the deepest target in the second touch. Once there are no more pointers\n     * that started within the responder, it should be released (even if there are\n     * active pointers elsewhere on the screen)\n     */\n    test('negotiates with deepest target on second touch if nothing is responder', () => {\n      const pointerType = 'touch';\n      let eventLog = [];\n      const grandParentCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('grandParent: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('grandParent: onStartShouldSetResponder');\n          return false;\n        },\n        onMoveShouldSetResponderCapture() {\n          eventLog.push('grandParent: onMoveShouldSetResponderCapture');\n          return false;\n        },\n        onMoveShouldSetResponder() {\n          eventLog.push('grandParent: onMoveShouldSetResponder');\n          return false;\n        }\n      };\n      const parentCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('parent: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('parent: onStartShouldSetResponder');\n          return false;\n        },\n        onMoveShouldSetResponderCapture() {\n          eventLog.push('parent: onMoveShouldSetResponderCapture');\n          return false;\n        },\n        onMoveShouldSetResponder() {\n          eventLog.push('parent: onMoveShouldSetResponder');\n          return false;\n        }\n      };\n      const targetCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('target: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('target: onStartShouldSetResponder');\n          return true;\n        },\n        onResponderGrant() {\n          eventLog.push('target: onResponderGrant');\n        },\n        onResponderStart() {\n          eventLog.push('target: onResponderStart');\n        },\n        onResponderMove() {\n          eventLog.push('target: onResponderMove');\n        },\n        onResponderEnd() {\n          eventLog.push('target: onResponderEnd');\n        },\n        onResponderRelease() {\n          eventLog.push('target: onResponderRelease');\n        }\n      };\n\n      const Component = () => {\n        useResponderEvents(grandParentRef, grandParentCallbacks);\n        useResponderEvents(parentRef, parentCallbacks);\n        useResponderEvents(targetRef, targetCallbacks);\n        return (\n          <div ref={grandParentRef}>\n            <div ref={parentRef}>\n              <div ref={targetRef} />\n            </div>\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const parent = createEventTarget(parentRef.current);\n      const target = createEventTarget(targetRef.current);\n\n      // gesture start on parent\n      act(() => {\n        parent.pointerdown({ pointerType, pointerId: 1 });\n      });\n      // initially nothing wants to become the responder\n      expect(getResponderNode()).toBe(null);\n      expect(eventLog).toEqual([\n        'grandParent: onStartShouldSetResponderCapture',\n        'parent: onStartShouldSetResponderCapture',\n        'parent: onStartShouldSetResponder',\n        'grandParent: onStartShouldSetResponder'\n      ]);\n      eventLog = [];\n      // second gesture start on target\n      act(() => {\n        target.pointerdown({ pointerType, pointerId: 2 });\n      });\n      // target should become responder\n      expect(getResponderNode()).toBe(targetRef.current);\n      expect(eventLog).toEqual([\n        'grandParent: onStartShouldSetResponderCapture',\n        'parent: onStartShouldSetResponderCapture',\n        'target: onStartShouldSetResponderCapture',\n        'target: onStartShouldSetResponder',\n        'target: onResponderGrant',\n        'target: onResponderStart'\n      ]);\n      eventLog = [];\n      // remove first touch, keep second touch that\n      // started within the current responder (target).\n      act(() => {\n        parent.pointerup({ pointerType, pointerId: 1 });\n      });\n      // responder doesn't change, \"end\" event called on responder\n      expect(getResponderNode()).toBe(targetRef.current);\n      expect(eventLog).toEqual(['target: onResponderEnd']);\n      eventLog = [];\n      // add touch back on parent\n      act(() => {\n        parent.pointerdown({ pointerType, pointerId: 1 });\n      });\n      // responder doesn't change, \"start\" event called on responder\n      expect(getResponderNode()).toBe(targetRef.current);\n      expect(eventLog).toEqual([\n        'grandParent: onStartShouldSetResponderCapture',\n        'parent: onStartShouldSetResponderCapture',\n        'parent: onStartShouldSetResponder',\n        'grandParent: onStartShouldSetResponder',\n        'target: onResponderStart'\n      ]);\n      eventLog = [];\n      // move touch on parent\n      act(() => {\n        parent.pointermove({ pointerType, pointerId: 1 });\n      });\n      // responder doesn't change, \"move\" event dispatched on responder\n      expect(getResponderNode()).toBe(targetRef.current);\n      expect(eventLog).toEqual([\n        'grandParent: onMoveShouldSetResponderCapture',\n        'parent: onMoveShouldSetResponderCapture',\n        'parent: onMoveShouldSetResponder',\n        'grandParent: onMoveShouldSetResponder',\n        'target: onResponderMove'\n      ]);\n      eventLog = [];\n      // remove touch that started within current responder\n      act(() => {\n        target.pointerup({ pointerType, pointerId: 2 });\n      });\n      // responder is released\n      expect(getResponderNode()).toBe(null);\n      expect(eventLog).toEqual([\n        'target: onResponderEnd',\n        'target: onResponderRelease'\n      ]);\n    });\n\n    /**\n     * If a node is responder, then the negotiation with a sibling should\n     * capture to and bubble from the first common ancestor.\n     */\n    test('negotiate from first common ancestor when there are siblings', () => {\n      const pointerType = 'touch';\n      let eventLog = [];\n      const grandParentCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('grandParent: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('grandParent: onStartShouldSetResponder');\n          return false;\n        },\n        onMoveShouldSetResponderCapture() {\n          eventLog.push('grandParent: onMoveShouldSetResponderCapture');\n          return false;\n        },\n        onMoveShouldSetResponder() {\n          eventLog.push('grandParent: onMoveShouldSetResponder');\n          return false;\n        }\n      };\n      const parentCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('parent: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('parent: onStartShouldSetResponder');\n          return false;\n        },\n        onMoveShouldSetResponderCapture() {\n          eventLog.push('parent: onMoveShouldSetResponderCapture');\n          return false;\n        },\n        onMoveShouldSetResponder() {\n          eventLog.push('parent: onMoveShouldSetResponder');\n          return false;\n        },\n        onResponderGrant() {\n          eventLog.push('parent: onResponderGrant');\n        },\n        onResponderStart() {\n          eventLog.push('parent: onResponderStart');\n        }\n      };\n      const targetCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('target: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('target: onStartShouldSetResponder');\n          return true;\n        },\n        onMoveShouldSetResponderCapture() {\n          eventLog.push('target: onMoveShouldSetResponderCapture');\n          return false;\n        },\n        onMoveShouldSetResponder() {\n          eventLog.push('target: onMoveShouldSetResponder');\n          return false;\n        },\n        onResponderGrant() {\n          eventLog.push('target: onResponderGrant');\n        },\n        onResponderStart() {\n          eventLog.push('target: onResponderStart');\n        },\n        onResponderMove() {\n          eventLog.push('target: onResponderMove');\n        }\n      };\n      const siblingCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('sibling: onStartShouldSetResponderCapture');\n          return true;\n        },\n        onResponderGrant() {\n          eventLog.push('sibling: onResponderGrant');\n        },\n        onResponderStart() {\n          eventLog.push('sibling: onResponderStart');\n        }\n      };\n\n      const Component = () => {\n        useResponderEvents(grandParentRef, grandParentCallbacks);\n        useResponderEvents(parentRef, parentCallbacks);\n        useResponderEvents(targetRef, targetCallbacks);\n        useResponderEvents(siblingRef, siblingCallbacks);\n        return (\n          <div ref={grandParentRef}>\n            <div ref={parentRef}>\n              <div ref={targetRef} />\n              <div ref={siblingRef} />\n            </div>\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      const sibling = createEventTarget(siblingRef.current);\n      // gesture start on target\n      act(() => {\n        target.pointerdown({ pointerType, pointerId: 1 });\n      });\n      expect(getResponderNode()).toBe(targetRef.current);\n      expect(eventLog).toEqual([\n        'grandParent: onStartShouldSetResponderCapture',\n        'parent: onStartShouldSetResponderCapture',\n        'target: onStartShouldSetResponderCapture',\n        'target: onStartShouldSetResponder',\n        'target: onResponderGrant',\n        'target: onResponderStart'\n      ]);\n      eventLog = [];\n      // second gesture start on sibling\n      act(() => {\n        sibling.pointerdown({ pointerType, pointerId: 2 });\n      });\n      // target remains responder\n      expect(getResponderNode()).toBe(targetRef.current);\n      // negotiates from first common ancestor of current responder and sibling (i.e., parent)\n      expect(eventLog).toEqual([\n        'grandParent: onStartShouldSetResponderCapture',\n        'parent: onStartShouldSetResponderCapture',\n        'parent: onStartShouldSetResponder',\n        'grandParent: onStartShouldSetResponder',\n        'target: onResponderStart'\n      ]);\n      eventLog = [];\n      // gesture move on target\n      act(() => {\n        target.pointermove({ pointerType, pointerId: 1 });\n      });\n      // target remains responder\n      expect(getResponderNode()).toBe(targetRef.current);\n      // negotiates from first common ancestor\n      expect(eventLog).toEqual([\n        'grandParent: onMoveShouldSetResponderCapture',\n        'parent: onMoveShouldSetResponderCapture',\n        'parent: onMoveShouldSetResponder',\n        'grandParent: onMoveShouldSetResponder',\n        'target: onResponderMove'\n      ]);\n      eventLog = [];\n      // gesture move on sibling\n      act(() => {\n        sibling.pointermove({ pointerType, pointerId: 2 });\n      });\n      // target remains responder\n      expect(getResponderNode()).toBe(targetRef.current);\n      // negotiates from first common ancestor\n      expect(eventLog).toEqual([\n        'grandParent: onMoveShouldSetResponderCapture',\n        'parent: onMoveShouldSetResponderCapture',\n        'parent: onMoveShouldSetResponder',\n        'grandParent: onMoveShouldSetResponder',\n        'target: onResponderMove'\n      ]);\n    });\n\n    /**\n     * If siblings are connected to the responder system but have no ancestors\n     * connected, there should be no negotiation between siblings after one\n     * becomes the active responder.\n     */\n    test('no negotation between siblings with no responder ancestors', () => {\n      const pointerType = 'mouse';\n      const eventLog = [];\n\n      const targetConfig = {\n        onStartShouldSetResponderCapture(e) {\n          eventLog.push('target: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder(e) {\n          eventLog.push('target: onStartShouldSetResponder');\n          return true;\n        },\n        onMoveShouldSetResponderCapture(e) {\n          eventLog.push('target: onMoveShouldSetResponderCapture');\n          return false;\n        },\n        onMoveShouldSetResponder(e) {\n          eventLog.push('target: onMoveShouldSetResponder');\n          return false;\n        },\n        onResponderGrant(e) {\n          eventLog.push('target: onResponderGrant');\n        },\n        onResponderStart(e) {\n          eventLog.push('target: onResponderStart');\n        },\n        onResponderMove(e) {\n          eventLog.push('target: onResponderMove');\n        }\n      };\n      const siblingConfig = {\n        onStartShouldSetResponderCapture(e) {\n          eventLog.push('sibling: onStartShouldSetResponderCapture');\n          return true;\n        },\n        onStartShouldSetResponder(e) {\n          eventLog.push('sibling: onStartShouldSetResponder');\n          return true;\n        },\n        onMoveShouldSetResponderCapture(e) {\n          eventLog.push('sibling: onMoveShouldSetResponderCapture');\n          return true;\n        },\n        onMoveShouldSetResponder(e) {\n          eventLog.push('sibling: onMoveShouldSetResponder');\n          return true;\n        },\n        onResponderGrant(e) {\n          eventLog.push('sibling: onResponderGrant');\n        },\n        onResponderStart(e) {\n          eventLog.push('sibling: onResponderStart');\n        },\n        onResponderMove(e) {\n          eventLog.push('sibling: onResponderMove');\n        }\n      };\n\n      const Component = () => {\n        useResponderEvents(targetRef, targetConfig);\n        useResponderEvents(siblingRef, siblingConfig);\n        return (\n          <div id=\"grandParent\">\n            <div id=\"parent\">\n              <div id=\"target\" ref={targetRef} />\n              <div id=\"sibling\" ref={siblingRef} />\n            </div>\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      const sibling = createEventTarget(siblingRef.current);\n      // gesture start and move on target\n      act(() => {\n        target.pointerdown({ pointerType });\n        target.pointermove({ pointerType });\n        sibling.pointermove({ pointerType });\n      });\n      // target remains responder, no negotation occurs\n      expect(eventLog).toEqual([\n        'target: onStartShouldSetResponderCapture',\n        'target: onStartShouldSetResponder',\n        'target: onResponderGrant',\n        'target: onResponderStart',\n        'target: onResponderMove',\n        'target: onResponderMove'\n      ]);\n    });\n\n    /**\n     * If a node is responder and it rejects a termination request, it\n     * should continue to receive responder events.\n     */\n    test('negotiation rejects and current responder receives events', () => {\n      const pointerType = 'touch';\n      let eventLog = [];\n      const grandParentCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('grandParent: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('grandParent: onStartShouldSetResponder');\n          return false;\n        },\n        onMoveShouldSetResponderCapture() {\n          eventLog.push('grandParent: onMoveShouldSetResponderCapture');\n          return false;\n        },\n        onMoveShouldSetResponder() {\n          eventLog.push('grandParent: onMoveShouldSetResponder');\n          return false;\n        }\n      };\n      const parentCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('parent: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('parent: onStartShouldSetResponder');\n          return true;\n        },\n        onMoveShouldSetResponderCapture() {\n          eventLog.push('parent: onMoveShouldSetResponderCapture');\n          return false;\n        },\n        onMoveShouldSetResponder() {\n          eventLog.push('parent: onMoveShouldSetResponder');\n          return true;\n        },\n        onResponderReject() {\n          eventLog.push('parent: onResponderReject');\n        }\n      };\n      const targetCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('target: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('target: onStartShouldSetResponder');\n          return true;\n        },\n        onResponderGrant() {\n          eventLog.push('target: onResponderGrant');\n        },\n        onResponderStart() {\n          eventLog.push('target: onResponderStart');\n        },\n        onResponderMove() {\n          eventLog.push('target: onResponderMove');\n        },\n        onResponderTerminationRequest() {\n          eventLog.push('target: onResponderTerminationRequest');\n          return false;\n        }\n      };\n\n      const Component = () => {\n        useResponderEvents(grandParentRef, grandParentCallbacks);\n        useResponderEvents(parentRef, parentCallbacks);\n        useResponderEvents(targetRef, targetCallbacks);\n        return (\n          <div ref={grandParentRef}>\n            <div ref={parentRef}>\n              <div ref={targetRef} />\n            </div>\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      // first touch\n      act(() => {\n        target.pointerdown({ pointerType });\n      });\n      // target becomes responder\n      expect(getResponderNode()).toBe(targetRef.current);\n      expect(eventLog).toEqual([\n        'grandParent: onStartShouldSetResponderCapture',\n        'parent: onStartShouldSetResponderCapture',\n        'target: onStartShouldSetResponderCapture',\n        'target: onStartShouldSetResponder',\n        'target: onResponderGrant',\n        'target: onResponderStart'\n      ]);\n      eventLog = [];\n      // move first touch\n      act(() => {\n        target.pointermove({ pointerType });\n      });\n      // target remains responder, parent was rejected\n      expect(getResponderNode()).toBe(targetRef.current);\n      expect(eventLog).toEqual([\n        'grandParent: onMoveShouldSetResponderCapture',\n        'parent: onMoveShouldSetResponderCapture',\n        'parent: onMoveShouldSetResponder',\n        'target: onResponderTerminationRequest',\n        'parent: onResponderReject',\n        'target: onResponderMove'\n      ]);\n      eventLog = [];\n      // add second touch\n      act(() => {\n        target.pointerdown({ pointerType, pointerId: 2 });\n      });\n      // target remains responder, parent was rejected\n      expect(getResponderNode()).toBe(targetRef.current);\n      expect(eventLog).toEqual([\n        'grandParent: onStartShouldSetResponderCapture',\n        'parent: onStartShouldSetResponderCapture',\n        'parent: onStartShouldSetResponder',\n        'target: onResponderTerminationRequest',\n        'parent: onResponderReject',\n        'target: onResponderStart'\n      ]);\n    });\n\n    test('negotiate scroll', () => {\n      const pointerType = 'touch';\n      let eventLog = [];\n      const grandParentCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('grandParent: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('grandParent: onStartShouldSetResponder');\n          return false;\n        },\n        onScrollShouldSetResponderCapture() {\n          eventLog.push('grandParent: onScrollShouldSetResponderCapture');\n          return false;\n        },\n        onScrollShouldSetResponder() {\n          eventLog.push('grandParent: onScrollShouldSetResponder');\n          return false;\n        }\n      };\n      const parentCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('parent: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('parent: onStartShouldSetResponder');\n          return false;\n        },\n        onScrollShouldSetResponderCapture() {\n          eventLog.push('parent: onScrollShouldSetResponderCapture');\n          return false;\n        },\n        onScrollShouldSetResponder() {\n          eventLog.push('parent: onScrollShouldSetResponder');\n          return true;\n        },\n        onResponderGrant() {\n          eventLog.push('parent: onResponderGrant');\n        },\n        onResponderReject() {\n          eventLog.push('parent: onResponderReject');\n        }\n      };\n      const targetCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('target: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('target: onStartShouldSetResponder');\n          return true;\n        },\n        onResponderGrant() {\n          eventLog.push('target: onResponderGrant');\n        },\n        onResponderStart() {\n          eventLog.push('target: onResponderStart');\n        },\n        onResponderMove() {\n          eventLog.push('target: onResponderMove');\n        },\n        onResponderTerminate() {\n          eventLog.push('target: onResponderTerminate');\n        },\n        onResponderTerminationRequest() {\n          eventLog.push('target: onResponderTerminationRequest');\n          // responders can avoid termination only for scroll events\n          return false;\n        }\n      };\n\n      const Component = () => {\n        useResponderEvents(grandParentRef, grandParentCallbacks);\n        useResponderEvents(parentRef, parentCallbacks);\n        useResponderEvents(targetRef, targetCallbacks);\n        return (\n          <div ref={grandParentRef}>\n            <div ref={parentRef}>\n              <div ref={targetRef} />\n            </div>\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      const parent = createEventTarget(parentRef.current);\n      // first touch\n      act(() => {\n        target.pointerdown({ pointerType });\n      });\n      // target becomes responder\n      expect(getResponderNode()).toBe(targetRef.current);\n      expect(eventLog).toEqual([\n        'grandParent: onStartShouldSetResponderCapture',\n        'parent: onStartShouldSetResponderCapture',\n        'target: onStartShouldSetResponderCapture',\n        'target: onStartShouldSetResponder',\n        'target: onResponderGrant',\n        'target: onResponderStart'\n      ]);\n      eventLog = [];\n      // then scroll\n      act(() => {\n        parent.scroll();\n      });\n      // target remains responder, parent rejected\n      expect(getResponderNode()).toBe(targetRef.current);\n      expect(eventLog).toEqual([\n        'grandParent: onScrollShouldSetResponderCapture',\n        'parent: onScrollShouldSetResponderCapture',\n        'parent: onScrollShouldSetResponder',\n        'target: onResponderTerminationRequest',\n        'parent: onResponderReject'\n      ]);\n      eventLog = [];\n      // now let the parent scroll take over\n      targetCallbacks.onResponderTerminationRequest = function () {\n        eventLog.push('target: onResponderTerminationRequest');\n        return true;\n      };\n      // scroll\n      act(() => {\n        parent.scroll();\n      });\n      expect(getResponderNode()).toBe(parentRef.current);\n      expect(eventLog).toEqual([\n        'grandParent: onScrollShouldSetResponderCapture',\n        'parent: onScrollShouldSetResponderCapture',\n        'parent: onScrollShouldSetResponder',\n        'target: onResponderTerminationRequest',\n        'target: onResponderTerminate',\n        'parent: onResponderGrant'\n      ]);\n    });\n\n    test('event stopPropagation  ', () => {\n      const pointerType = 'touch';\n      const eventLog = [];\n      const grandParentCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('grandParent: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('grandParent: onStartShouldSetResponder');\n          return false;\n        }\n      };\n      const parentCallbacks = {\n        onStartShouldSetResponderCapture(e) {\n          eventLog.push('parent: onStartShouldSetResponderCapture');\n          e.stopPropagation();\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('parent: onStartShouldSetResponder');\n          return false;\n        }\n      };\n      const targetCallbacks = {\n        onStartShouldSetResponderCapture() {\n          eventLog.push('target: onStartShouldSetResponderCapture');\n          return false;\n        },\n        onStartShouldSetResponder() {\n          eventLog.push('target: onStartShouldSetResponder');\n          return true;\n        }\n      };\n\n      const Component = () => {\n        useResponderEvents(grandParentRef, grandParentCallbacks);\n        useResponderEvents(parentRef, parentCallbacks);\n        useResponderEvents(targetRef, targetCallbacks);\n        return (\n          <div ref={grandParentRef}>\n            <div ref={parentRef}>\n              <div ref={targetRef} />\n            </div>\n          </div>\n        );\n      };\n\n      // render\n      render(<Component />);\n      const target = createEventTarget(targetRef.current);\n      act(() => {\n        target.pointerdown({ pointerType });\n      });\n      expect(eventLog).toEqual([\n        'grandParent: onStartShouldSetResponderCapture',\n        'parent: onStartShouldSetResponderCapture'\n      ]);\n      expect(getResponderNode()).toBe(null);\n    });\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useResponderEvents/createResponderEvent.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher\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 * @flow\n */\n\nimport type {\n  ResponderTouchHistoryStore,\n  TouchHistory\n} from './ResponderTouchHistoryStore';\nimport type { TouchEvent } from './ResponderEventTypes';\n\nimport getBoundingClientRect from '../../modules/getBoundingClientRect';\n\nexport type ResponderEvent = {|\n  bubbles: boolean,\n  cancelable: boolean,\n  currentTarget: any,\n  defaultPrevented: ?boolean,\n  dispatchConfig: {\n    registrationName?: string,\n    phasedRegistrationNames?: {\n      bubbled: string,\n      captured: string\n    }\n  },\n  eventPhase: ?number,\n  isDefaultPrevented: () => boolean,\n  isPropagationStopped: () => boolean,\n  isTrusted: ?boolean,\n  preventDefault: () => void,\n  stopPropagation: () => void,\n  nativeEvent: TouchEvent,\n  persist: () => void,\n  target: ?any,\n  timeStamp: number,\n  touchHistory: TouchHistory\n|};\n\nconst emptyFunction = () => {};\nconst emptyObject = {};\nconst emptyArray = [];\n\n/**\n * Safari produces very large identifiers that would cause the `touchBank` array\n * length to be so large as to crash the browser, if not normalized like this.\n * In the future the `touchBank` should use an object/map instead.\n */\nfunction normalizeIdentifier(identifier) {\n  return identifier > 20 ? identifier % 20 : identifier;\n}\n\n/**\n * Converts a native DOM event to a ResponderEvent.\n * Mouse events are transformed into fake touch events.\n */\nexport default function createResponderEvent(\n  domEvent: any,\n  responderTouchHistoryStore: ResponderTouchHistoryStore\n): ResponderEvent {\n  let rect;\n  let propagationWasStopped = false;\n  let changedTouches;\n  let touches;\n\n  const domEventChangedTouches = domEvent.changedTouches;\n  const domEventType = domEvent.type;\n\n  const metaKey = domEvent.metaKey === true;\n  const shiftKey = domEvent.shiftKey === true;\n  const force =\n    (domEventChangedTouches && domEventChangedTouches[0].force) || 0;\n  const identifier = normalizeIdentifier(\n    (domEventChangedTouches && domEventChangedTouches[0].identifier) || 0\n  );\n  const clientX =\n    (domEventChangedTouches && domEventChangedTouches[0].clientX) ||\n    domEvent.clientX;\n  const clientY =\n    (domEventChangedTouches && domEventChangedTouches[0].clientY) ||\n    domEvent.clientY;\n  const pageX =\n    (domEventChangedTouches && domEventChangedTouches[0].pageX) ||\n    domEvent.pageX;\n  const pageY =\n    (domEventChangedTouches && domEventChangedTouches[0].pageY) ||\n    domEvent.pageY;\n  const preventDefault =\n    typeof domEvent.preventDefault === 'function'\n      ? domEvent.preventDefault.bind(domEvent)\n      : emptyFunction;\n  const timestamp = domEvent.timeStamp;\n\n  function normalizeTouches(touches) {\n    return Array.prototype.slice.call(touches).map((touch) => {\n      return {\n        force: touch.force,\n        identifier: normalizeIdentifier(touch.identifier),\n        get locationX() {\n          return locationX(touch.clientX);\n        },\n        get locationY() {\n          return locationY(touch.clientY);\n        },\n        pageX: touch.pageX,\n        pageY: touch.pageY,\n        target: touch.target,\n        timestamp\n      };\n    });\n  }\n\n  if (domEventChangedTouches != null) {\n    changedTouches = normalizeTouches(domEventChangedTouches);\n    touches = normalizeTouches(domEvent.touches);\n  } else {\n    const emulatedTouches = [\n      {\n        force,\n        identifier,\n        get locationX() {\n          return locationX(clientX);\n        },\n        get locationY() {\n          return locationY(clientY);\n        },\n        pageX,\n        pageY,\n        target: domEvent.target,\n        timestamp\n      }\n    ];\n    changedTouches = emulatedTouches;\n    touches =\n      domEventType === 'mouseup' || domEventType === 'dragstart'\n        ? emptyArray\n        : emulatedTouches;\n  }\n\n  const responderEvent = {\n    bubbles: true,\n    cancelable: true,\n    // `currentTarget` is set before dispatch\n    currentTarget: null,\n    defaultPrevented: domEvent.defaultPrevented,\n    dispatchConfig: emptyObject,\n    eventPhase: domEvent.eventPhase,\n    isDefaultPrevented() {\n      return domEvent.defaultPrevented;\n    },\n    isPropagationStopped() {\n      return propagationWasStopped;\n    },\n    isTrusted: domEvent.isTrusted,\n    nativeEvent: {\n      altKey: false,\n      ctrlKey: false,\n      metaKey,\n      shiftKey,\n      changedTouches,\n      force,\n      identifier,\n      get locationX() {\n        return locationX(clientX);\n      },\n      get locationY() {\n        return locationY(clientY);\n      },\n      pageX,\n      pageY,\n      target: domEvent.target,\n      timestamp,\n      touches,\n      type: domEventType\n    },\n    persist: emptyFunction,\n    preventDefault,\n    stopPropagation() {\n      propagationWasStopped = true;\n    },\n    target: domEvent.target,\n    timeStamp: timestamp,\n    touchHistory: responderTouchHistoryStore.touchHistory\n  };\n\n  // Using getters and functions serves two purposes:\n  // 1) The value of `currentTarget` is not initially available.\n  // 2) Measuring the clientRect may cause layout jank and should only be done on-demand.\n  function locationX(x) {\n    rect = rect || getBoundingClientRect(responderEvent.currentTarget);\n    if (rect) {\n      return x - rect.left;\n    }\n  }\n  function locationY(y) {\n    rect = rect || getBoundingClientRect(responderEvent.currentTarget);\n    if (rect) {\n      return y - rect.top;\n    }\n  }\n\n  return responderEvent;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useResponderEvents/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher\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 * @flow\n */\n\n/**\n * Hook for integrating the Responder System into React\n *\n *   function SomeComponent({ onStartShouldSetResponder }) {\n *     const ref = useRef(null);\n *     useResponderEvents(ref, { onStartShouldSetResponder });\n *     return <div ref={ref} />\n *   }\n */\n\nimport type { ResponderConfig } from './ResponderSystem';\n\nimport * as React from 'react';\nimport * as ResponderSystem from './ResponderSystem';\n\nconst emptyObject = {};\nlet idCounter = 0;\n\nfunction useStable<T>(getInitialValue: () => T): T {\n  const ref = React.useRef<T | null>(null);\n  if (ref.current == null) {\n    ref.current = getInitialValue();\n  }\n  return ref.current;\n}\n\nexport default function useResponderEvents(\n  hostRef: any,\n  config: ResponderConfig = emptyObject\n) {\n  const id = useStable(() => idCounter++);\n  const isAttachedRef = React.useRef(false);\n\n  // This is a separate effects so it doesn't run when the config changes.\n  // On initial mount, attach global listeners if needed.\n  // On unmount, remove node potentially attached to the Responder System.\n  React.useEffect(() => {\n    ResponderSystem.attachListeners();\n    return () => {\n      ResponderSystem.removeNode(id);\n    };\n  }, [id]);\n\n  // Register and unregister with the Responder System as necessary\n  React.useEffect(() => {\n    const {\n      onMoveShouldSetResponder,\n      onMoveShouldSetResponderCapture,\n      onScrollShouldSetResponder,\n      onScrollShouldSetResponderCapture,\n      onSelectionChangeShouldSetResponder,\n      onSelectionChangeShouldSetResponderCapture,\n      onStartShouldSetResponder,\n      onStartShouldSetResponderCapture\n    } = config;\n\n    const requiresResponderSystem =\n      onMoveShouldSetResponder != null ||\n      onMoveShouldSetResponderCapture != null ||\n      onScrollShouldSetResponder != null ||\n      onScrollShouldSetResponderCapture != null ||\n      onSelectionChangeShouldSetResponder != null ||\n      onSelectionChangeShouldSetResponderCapture != null ||\n      onStartShouldSetResponder != null ||\n      onStartShouldSetResponderCapture != null;\n\n    const node = hostRef.current;\n\n    if (requiresResponderSystem) {\n      ResponderSystem.addNode(id, node, config);\n      isAttachedRef.current = true;\n    } else if (isAttachedRef.current) {\n      ResponderSystem.removeNode(id);\n      isAttachedRef.current = false;\n    }\n  }, [config, hostRef, id]);\n\n  React.useDebugValue({\n    isResponder: hostRef.current === ResponderSystem.getResponderNode()\n  });\n  React.useDebugValue(config);\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useResponderEvents/utils.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher\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 * @flow\n */\n\nimport isSelectionValid from '../../modules/isSelectionValid';\n\nconst keyName = '__reactResponderId';\n\nfunction getEventPath(domEvent: any): Array<any> {\n  // The 'selectionchange' event always has the 'document' as the target.\n  // Use the anchor node as the initial target to reconstruct a path.\n  // (We actually only need the first \"responder\" node in practice.)\n  if (domEvent.type === 'selectionchange') {\n    const target = window.getSelection().anchorNode;\n    return composedPathFallback(target);\n  } else {\n    const path =\n      domEvent.composedPath != null\n        ? domEvent.composedPath()\n        : composedPathFallback(domEvent.target);\n    return path;\n  }\n}\n\nfunction composedPathFallback(target: any): Array<any> {\n  const path = [];\n  while (target != null && target !== document.body) {\n    path.push(target);\n    target = target.parentNode;\n  }\n  return path;\n}\n\n/**\n * Retrieve the responderId from a host node\n */\nfunction getResponderId(node: any): ?number {\n  if (node != null) {\n    return node[keyName];\n  }\n  return null;\n}\n\n/**\n * Store the responderId on a host node\n */\nexport function setResponderId(node: any, id: number) {\n  if (node != null) {\n    node[keyName] = id;\n  }\n}\n\n/**\n * Filter the event path to contain only the nodes attached to the responder system\n */\nexport function getResponderPaths(domEvent: any): {|\n  idPath: Array<number>,\n  nodePath: Array<any>\n|} {\n  const idPath = [];\n  const nodePath = [];\n  const eventPath = getEventPath(domEvent);\n  for (let i = 0; i < eventPath.length; i++) {\n    const node = eventPath[i];\n    const id = getResponderId(node);\n    if (id != null) {\n      idPath.push(id);\n      nodePath.push(node);\n    }\n  }\n  return { idPath, nodePath };\n}\n\n/**\n * Walk the paths and find the first common ancestor\n */\nexport function getLowestCommonAncestor(\n  pathA: Array<any>,\n  pathB: Array<any>\n): any {\n  let pathALength = pathA.length;\n  let pathBLength = pathB.length;\n  if (\n    // If either path is empty\n    pathALength === 0 ||\n    pathBLength === 0 ||\n    // If the last elements aren't the same there can't be a common ancestor\n    // that is connected to the responder system\n    pathA[pathALength - 1] !== pathB[pathBLength - 1]\n  ) {\n    return null;\n  }\n\n  let itemA = pathA[0];\n  let indexA = 0;\n  let itemB = pathB[0];\n  let indexB = 0;\n\n  // If A is deeper, skip indices that can't match.\n  if (pathALength - pathBLength > 0) {\n    indexA = pathALength - pathBLength;\n    itemA = pathA[indexA];\n    pathALength = pathBLength;\n  }\n\n  // If B is deeper, skip indices that can't match\n  if (pathBLength - pathALength > 0) {\n    indexB = pathBLength - pathALength;\n    itemB = pathB[indexB];\n    pathBLength = pathALength;\n  }\n\n  // Walk in lockstep until a match is found\n  let depth = pathALength;\n  while (depth--) {\n    if (itemA === itemB) {\n      return itemA;\n    }\n    itemA = pathA[indexA++];\n    itemB = pathB[indexB++];\n  }\n  return null;\n}\n\n/**\n * Determine whether any of the active touches are within the current responder.\n * This cannot rely on W3C `targetTouches`, as neither IE11 nor Safari implement it.\n */\nexport function hasTargetTouches(target: any, touches: any): boolean {\n  if (!touches || touches.length === 0) {\n    return false;\n  }\n  for (let i = 0; i < touches.length; i++) {\n    const node = touches[i].target;\n    if (node != null) {\n      if (target.contains(node)) {\n        return true;\n      }\n    }\n  }\n  return false;\n}\n\n/**\n * Ignore 'selectionchange' events that don't correspond with a person's intent to\n * select text.\n */\nexport function hasValidSelection(domEvent: any): boolean {\n  if (domEvent.type === 'selectionchange') {\n    return isSelectionValid();\n  }\n  return domEvent.type === 'select';\n}\n\n/**\n * Events are only valid if the primary button was used without specific modifier keys.\n */\nexport function isPrimaryPointerDown(domEvent: any): boolean {\n  const { altKey, button, buttons, ctrlKey, type } = domEvent;\n  const isTouch = type === 'touchstart' || type === 'touchmove';\n  const isPrimaryMouseDown =\n    type === 'mousedown' && (button === 0 || buttons === 1);\n  const isPrimaryMouseMove = type === 'mousemove' && buttons === 1;\n  const noModifiers = altKey === false && ctrlKey === false;\n\n  if (\n    isTouch ||\n    (isPrimaryMouseDown && noModifiers) ||\n    (isPrimaryMouseMove && noModifiers)\n  ) {\n    return true;\n  }\n  return false;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useStable/__tests__/index-test.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n */\n\nimport * as React from 'react';\nimport { render } from '@testing-library/react';\nimport useStable from '..';\n\ndescribe('useStable', () => {\n  let spy = {};\n\n  const TestComponent = ({ initialValueCallback }): React.Node => {\n    const value = useStable(initialValueCallback);\n    spy.value = value;\n    return null;\n  };\n\n  beforeEach(() => {\n    spy = {};\n  });\n\n  test('correctly sets the initial value', () => {\n    const initialValueCallback = () => 5;\n    render(<TestComponent initialValueCallback={initialValueCallback} />);\n    expect(spy.value).toBe(5);\n  });\n\n  test('does not change the value', () => {\n    let counter = 0;\n    const initialValueCallback = () => counter++;\n    const { rerender } = render(\n      <TestComponent initialValueCallback={initialValueCallback} />\n    );\n    expect(spy.value).toBe(0);\n    rerender(<TestComponent initialValueCallback={initialValueCallback} />);\n    expect(spy.value).toBe(0);\n  });\n\n  test('only calls the callback once', () => {\n    let counter = 0;\n    const initialValueCallback = () => counter++;\n    const { rerender } = render(\n      <TestComponent initialValueCallback={initialValueCallback} />\n    );\n    expect(counter).toBe(1);\n    rerender(<TestComponent initialValueCallback={initialValueCallback} />);\n    expect(counter).toBe(1);\n  });\n\n  test('does not change the value if the callback initially returns null', () => {\n    let counter = 0;\n    const initialValueCallback = () => {\n      if (counter === 0) {\n        counter++;\n        return null;\n      }\n      return counter++;\n    };\n    const { rerender } = render(\n      <TestComponent initialValueCallback={initialValueCallback} />\n    );\n    expect(spy.value).toBe(null);\n    rerender(<TestComponent initialValueCallback={initialValueCallback} />);\n    expect(spy.value).toBe(null);\n  });\n});\n"
  },
  {
    "path": "packages/react-native-web/src/modules/useStable/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n */\n\nimport * as React from 'react';\n\nconst UNINITIALIZED =\n  typeof Symbol === 'function' && typeof Symbol() === 'symbol'\n    ? Symbol()\n    : Object.freeze({});\n\nexport default function useStable<T>(getInitialValue: () => T): T {\n  const ref = React.useRef(UNINITIALIZED);\n  if (ref.current === UNINITIALIZED) {\n    ref.current = getInitialValue();\n  }\n  // $FlowFixMe (#64650789) Trouble refining types where `Symbol` is concerned.\n  return ref.current;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/modules/warnOnce/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict\n */\n\nconst warnedKeys: { [string]: boolean, ... } = {};\n\n/**\n * A simple function that prints a warning message once per session.\n *\n * @param {string} key - The key used to ensure the message is printed once.\n *                       This should be unique to the callsite.\n * @param {string} message - The message to print\n */\nexport function warnOnce(key: string, message: string) {\n  if (process.env.NODE_ENV !== 'production') {\n    if (warnedKeys[key]) {\n      return;\n    }\n\n    console.warn(message);\n\n    warnedKeys[key] = true;\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web/src/types/index.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nexport type ColorValue = null | string;\n\nexport type DimensionValue = null | number | string;\n\nexport type EdgeInsetsValue = {|\n  top: number,\n  left: number,\n  right: number,\n  bottom: number\n|};\n\nexport type GenericStyleProp<+T> =\n  | null\n  | void\n  | $ReadOnly<T>\n  | false\n  | ''\n  | $ReadOnlyArray<GenericStyleProp<T>>;\n\nexport type LayoutValue = {\n  x: number,\n  y: number,\n  width: number,\n  height: number\n};\n\nexport type LayoutEvent = {\n  nativeEvent: {\n    layout: LayoutValue,\n    target: any\n  },\n  timeStamp: number\n};\n\nexport type PointValue = {|\n  x: number,\n  y: number\n|};\n\ntype LayoutCallback = (\n  x: number,\n  y: number,\n  width: number,\n  height: number,\n  left: number,\n  top: number\n) => void;\n\ntype MeasureInWindowCallback = (\n  left: number,\n  top: number,\n  width: number,\n  height: number\n) => void;\n\n// Mixin to HTMLElement that represents additions from the `usePlatformMethods` hook\nexport interface PlatformMethods {\n  blur: () => void;\n  focus: () => void;\n  measure: (callback: LayoutCallback) => void;\n  measureInWindow: (callback: MeasureInWindowCallback) => void;\n  measureLayout: (\n    relativeToNativeNode: {},\n    onSuccess: LayoutCallback,\n    onFail: () => void\n  ) => void;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/types/styles.js",
    "content": "/**\n * Copyright (c) Nicolas Gallagher.\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 * @flow\n */\n\nimport type { ColorValue, DimensionValue } from './index';\n\ntype NumberOrString = number | string;\n\n/**\n * Animations and transitions\n */\n\ntype AnimationDirection =\n  | 'alternate'\n  | 'alternate-reverse'\n  | 'normal'\n  | 'reverse';\ntype AnimationFillMode = 'none' | 'forwards' | 'backwards' | 'both';\ntype AnimationIterationCount = number | 'infinite';\ntype AnimationKeyframes = string | Object;\ntype AnimationPlayState = 'paused' | 'running';\n\nexport type AnimationStyles = {|\n  animationDelay?: ?(string | Array<string>),\n  animationDirection?: ?(AnimationDirection | Array<AnimationDirection>),\n  animationDuration?: ?(string | Array<string>),\n  animationFillMode?: ?(AnimationFillMode | Array<AnimationFillMode>),\n  animationIterationCount?: ?(\n    | AnimationIterationCount\n    | Array<AnimationIterationCount>\n  ),\n  animationKeyframes?: ?(AnimationKeyframes | Array<AnimationKeyframes>),\n  animationPlayState?: ?(AnimationPlayState | Array<AnimationPlayState>),\n  animationTimingFunction?: ?(string | Array<string>),\n  transitionDelay?: ?(string | Array<string>),\n  transitionDuration?: ?(string | Array<string>),\n  transitionProperty?: ?(string | Array<string>),\n  transitionTimingFunction?: ?(string | Array<string>)\n|};\n\n/**\n * Border\n */\n\ntype BorderRadiusValue = number | string;\ntype BorderStyleValue = 'solid' | 'dotted' | 'dashed';\n\nexport type BorderStyles = {|\n  // color\n  borderColor?: ?ColorValue,\n  borderBlockColor?: ?ColorValue,\n  borderBlockEndColor?: ?ColorValue,\n  borderBlockStartColor?: ?ColorValue,\n  borderBottomColor?: ?ColorValue,\n  borderInlineColor?: ?ColorValue,\n  borderInlineEndColor?: ?ColorValue,\n  borderInlineStartColor?: ?ColorValue,\n  borderLeftColor?: ?ColorValue,\n  borderRightColor?: ?ColorValue,\n  borderTopColor?: ?ColorValue,\n  // radius\n  borderRadius?: ?BorderRadiusValue,\n  borderEndEndRadius?: ?BorderRadiusValue,\n  borderEndStartRadius?: ?BorderRadiusValue,\n  borderStartEndRadius?: ?BorderRadiusValue,\n  borderStartStartRadius?: ?BorderRadiusValue,\n  borderBottomLeftRadius?: ?BorderRadiusValue,\n  borderBottomRightRadius?: ?BorderRadiusValue,\n  borderTopLeftRadius?: ?BorderRadiusValue,\n  borderTopRightRadius?: ?BorderRadiusValue,\n  // style\n  borderStyle?: ?BorderStyleValue,\n  borderBlockStyle?: ?BorderStyleValue,\n  borderBlockEndStyle?: ?BorderStyleValue,\n  borderBlockStartStyle?: ?BorderStyleValue,\n  borderBottomStyle?: ?BorderStyleValue,\n  borderInlineStyle?: ?BorderStyleValue,\n  borderInlineEndStyle?: ?BorderStyleValue,\n  borderInlineStartStyle?: ?BorderStyleValue,\n  borderLeftStyle?: ?BorderStyleValue,\n  borderRightStyle?: ?BorderStyleValue,\n  borderTopStyle?: ?BorderStyleValue,\n  // deprecated\n  borderEndColor?: ?ColorValue,\n  borderStartColor?: ?ColorValue,\n  borderEndStyle?: ?BorderStyleValue,\n  borderStartStyle?: ?BorderStyleValue,\n  borderBottomEndRadius?: ?BorderRadiusValue,\n  borderBottomStartRadius?: ?BorderRadiusValue,\n  borderTopEndRadius?: ?BorderRadiusValue,\n  borderTopStartRadius?: ?BorderRadiusValue\n|};\n\n/**\n * Interactions\n */\n\ntype CursorValue =\n  | 'alias'\n  | 'all-scroll'\n  | 'auto'\n  | 'cell'\n  | 'context-menu'\n  | 'copy'\n  | 'crosshair'\n  | 'default'\n  | 'grab'\n  | 'grabbing'\n  | 'help'\n  | 'pointer'\n  | 'progress'\n  | 'wait'\n  | 'text'\n  | 'vertical-text'\n  | 'move'\n  | 'none'\n  | 'no-drop'\n  | 'not-allowed'\n  | 'zoom-in'\n  | 'zoom-out'\n  // resize\n  | 'col-resize'\n  | 'e-resize'\n  | 'ew-resize'\n  | 'n-resize'\n  | 'ne-resize'\n  | 'ns-resize'\n  | 'nw-resize'\n  | 'row-resize'\n  | 's-resize'\n  | 'se-resize'\n  | 'sw-resize'\n  | 'w-resize'\n  | 'nesw-resize'\n  | 'nwse-resize';\n\ntype TouchActionValue =\n  | 'auto'\n  | 'inherit'\n  | 'manipulation'\n  | 'none'\n  | 'pan-down'\n  | 'pan-left'\n  | 'pan-right'\n  | 'pan-up'\n  | 'pan-x'\n  | 'pan-y'\n  | 'pinch-zoom';\n\ntype UserSelect = 'all' | 'auto' | 'contain' | 'none' | 'text';\n\nexport type InteractionStyles = {|\n  // https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Formal_syntax\n  cursor?: ?CursorValue,\n  // https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action#Formal_syntax\n  touchAction?: ?TouchActionValue,\n  // https://developer.mozilla.org/en-US/docs/Web/CSS/user-select#Formal_syntax_2\n  userSelect?: ?UserSelect,\n  willChange?: ?string\n|};\n\n/**\n * Layout\n */\n\ntype OverflowValue = 'auto' | 'hidden' | 'scroll' | 'visible';\ntype VisiblilityValue = 'hidden' | 'visible';\n\nexport type LayoutStyles = {|\n  alignContent?:\n    | 'center'\n    | 'flex-end'\n    | 'flex-start'\n    | 'space-around'\n    | 'space-between'\n    | 'stretch',\n  alignItems?: ?('baseline' | 'center' | 'flex-end' | 'flex-start' | 'stretch'),\n  alignSelf?: ?(\n    | 'auto'\n    | 'baseline'\n    | 'center'\n    | 'flex-end'\n    | 'flex-start'\n    | 'stretch'\n  ),\n  aspectRatio?: ?NumberOrString,\n  backfaceVisibility?: ?VisiblilityValue,\n  borderWidth?: ?DimensionValue,\n  borderBlockWidth?: ?DimensionValue,\n  borderBlockEndWidth?: ?DimensionValue,\n  borderBlockStartWidth?: ?DimensionValue,\n  borderBottomWidth?: ?DimensionValue,\n  borderInlineWidth?: ?DimensionValue,\n  borderInlineEndWidth?: ?DimensionValue,\n  borderInlineStartWidth?: ?DimensionValue,\n  borderLeftWidth?: ?DimensionValue,\n  borderRightWidth?: ?DimensionValue,\n  borderTopWidth?: ?DimensionValue,\n  bottom?: ?DimensionValue,\n  boxSizing?: ?('border-box' | 'content-box' | 'padding-box'),\n  columnGap?: ?DimensionValue,\n  direction?: ?('inherit' | 'ltr' | 'rtl'),\n  display?: ?string,\n  flex?: ?number,\n  flexBasis?: ?DimensionValue,\n  flexDirection?: ?('column' | 'column-reverse' | 'row' | 'row-reverse'),\n  flexGrow?: ?number,\n  flexShrink?: ?number,\n  flexWrap?: ?('nowrap' | 'wrap' | 'wrap-reverse'),\n  gap?: ?DimensionValue,\n  height?: ?DimensionValue,\n  inset?: ?DimensionValue,\n  insetBlock?: ?DimensionValue,\n  insetBlockEnd?: ?DimensionValue,\n  insetBlockStart?: ?DimensionValue,\n  insetInline?: ?DimensionValue,\n  insetInlineEnd?: ?DimensionValue,\n  insetInlineStart?: ?DimensionValue,\n  justifyContent?: ?(\n    | 'center'\n    | 'flex-end'\n    | 'flex-start'\n    | 'space-around'\n    | 'space-between'\n    | 'space-evenly'\n  ),\n  left?: ?DimensionValue,\n  margin?: ?DimensionValue,\n  marginBlock?: ?DimensionValue,\n  marginBlockEnd?: ?DimensionValue,\n  marginBlockStart?: ?DimensionValue,\n  marginBottom?: ?DimensionValue,\n  marginInline?: ?DimensionValue,\n  marginInlineEnd?: ?DimensionValue,\n  marginInlineStart?: ?DimensionValue,\n  marginLeft?: ?DimensionValue,\n  marginRight?: ?DimensionValue,\n  marginTop?: ?DimensionValue,\n  maxHeight?: ?DimensionValue,\n  maxWidth?: ?DimensionValue,\n  minHeight?: ?DimensionValue,\n  minWidth?: ?DimensionValue,\n  order?: ?number,\n  overflow?: ?OverflowValue,\n  overflowX?: ?OverflowValue,\n  overflowY?: ?OverflowValue,\n  padding?: ?DimensionValue,\n  paddingBlock?: ?DimensionValue,\n  paddingBlockEnd?: ?DimensionValue,\n  paddingBlockStart?: ?DimensionValue,\n  paddingBottom?: ?DimensionValue,\n  paddingInline?: ?DimensionValue,\n  paddingInlineEnd?: ?DimensionValue,\n  paddingInlineStart?: ?DimensionValue,\n  paddingLeft?: ?DimensionValue,\n  paddingRight?: ?DimensionValue,\n  paddingTop?: ?DimensionValue,\n  position?: ?('absolute' | 'fixed' | 'relative' | 'static' | 'sticky'),\n  right?: ?DimensionValue,\n  rowGap?: ?DimensionValue,\n  top?: ?DimensionValue,\n  visibility?: ?VisiblilityValue,\n  width?: ?DimensionValue,\n  zIndex?: ?number,\n  /**\n   * @platform web\n   */\n  gridAutoColumns?: ?string,\n  gridAutoFlow?: ?string,\n  gridAutoRows?: ?string,\n  gridColumnEnd?: ?string,\n  gridColumnGap?: ?string,\n  gridColumnStart?: ?string,\n  gridRowEnd?: ?string,\n  gridRowGap?: ?string,\n  gridRowStart?: ?string,\n  gridTemplateColumns?: ?string,\n  gridTemplateRows?: ?string,\n  gridTemplateAreas?: ?string,\n  /**\n   * @deprecated\n   */\n  borderEndWidth?: ?DimensionValue,\n  borderStartWidth?: ?DimensionValue,\n  end?: ?DimensionValue,\n  marginHorizontal?: ?DimensionValue,\n  marginEnd?: ?DimensionValue,\n  marginStart?: ?DimensionValue,\n  marginVertical?: ?DimensionValue,\n  paddingHorizontal?: ?DimensionValue,\n  paddingStart?: ?DimensionValue,\n  paddingEnd?: ?DimensionValue,\n  paddingVertical?: ?DimensionValue,\n  start?: ?DimensionValue\n|};\n\n/**\n * Shadows\n */\n\nexport type ShadowStyles = {|\n  // @deprecated\n  shadowColor?: ?ColorValue,\n  shadowOffset?: ?{|\n    width?: DimensionValue,\n    height?: DimensionValue\n  |},\n  shadowOpacity?: ?number,\n  shadowRadius?: ?DimensionValue\n|};\n\n/**\n * Transforms\n */\n\nexport type TransformStyles = {|\n  perspective?: ?NumberOrString,\n  perspectiveOrigin?: ?string,\n  transform?:\n    | ?string\n    | Array<\n        | {| +perspective: NumberOrString |}\n        | {| +rotate: string |}\n        | {| +rotateX: string |}\n        | {| +rotateY: string |}\n        | {| +rotateZ: string |}\n        | {| +scale: number |}\n        | {| +scaleX: number |}\n        | {| +scaleY: number |}\n        | {| +scaleZ: number |}\n        | {| +scale3d: string |}\n        | {| +skewX: string |}\n        | {| +skewY: string |}\n        | {| +translateX: NumberOrString |}\n        | {| +translateY: NumberOrString |}\n        | {| +translateZ: NumberOrString |}\n        | {| +translate3d: string |}\n      >,\n  transformOrigin?: ?string | Array<NumberOrString>,\n  transformStyle?: ?('flat' | 'preserve-3d')\n|};\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/hash/index.js",
    "content": "/* eslint-disable */\n\n/**\n * JS Implementation of MurmurHash2\n *\n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\n * @see http://github.com/garycourt/murmurhash-js\n * @author <a href=\"mailto:aappleby@gmail.com\">Austin Appleby</a>\n * @see http://sites.google.com/site/murmurhash/\n *\n * @param {string} str ASCII only\n * @param {number} seed Positive integer only\n * @return {number} 32-bit positive integer hash\n *\n * @flow\n */\n\nfunction murmurhash2_32_gc(str, seed) {\n  var l = str.length,\n    h = seed ^ l,\n    i = 0,\n    k;\n\n  while (l >= 4) {\n    k =\n      (str.charCodeAt(i) & 0xff) |\n      ((str.charCodeAt(++i) & 0xff) << 8) |\n      ((str.charCodeAt(++i) & 0xff) << 16) |\n      ((str.charCodeAt(++i) & 0xff) << 24);\n\n    k = (k & 0xffff) * 0x5bd1e995 + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16);\n    k ^= k >>> 24;\n    k = (k & 0xffff) * 0x5bd1e995 + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16);\n\n    h = ((h & 0xffff) * 0x5bd1e995 + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)) ^ k;\n\n    l -= 4;\n    ++i;\n  }\n\n  switch (l) {\n    case 3:\n      h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n    case 2:\n      h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n    case 1:\n      h ^= str.charCodeAt(i) & 0xff;\n      h = (h & 0xffff) * 0x5bd1e995 + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16);\n  }\n\n  h ^= h >>> 13;\n  h = (h & 0xffff) * 0x5bd1e995 + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16);\n  h ^= h >>> 15;\n\n  return h >>> 0;\n}\n\nconst hash = (str: string): string => murmurhash2_32_gc(str, 1).toString(36);\n\nexport default hash;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/Animated.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\nimport Platform from '../../../exports/Platform';\nimport typeof AnimatedFlatList from './components/AnimatedFlatList';\nimport typeof AnimatedImage from './components/AnimatedImage';\nimport typeof AnimatedScrollView from './components/AnimatedScrollView';\nimport typeof AnimatedSectionList from './components/AnimatedSectionList';\nimport typeof AnimatedText from './components/AnimatedText';\nimport typeof AnimatedView from './components/AnimatedView';\n\nimport FlatList from './components/AnimatedFlatList';\nimport Image from './components/AnimatedImage';\nimport ScrollView from './components/AnimatedScrollView';\nimport SectionList from './components/AnimatedSectionList';\nimport Text from './components/AnimatedText';\nimport View from './components/AnimatedView';\n\nimport AnimatedMock from './AnimatedMock';\nimport AnimatedImplementation from './AnimatedImplementation';\n\nconst Animated = ((Platform.isTesting\n  ? AnimatedMock\n  : AnimatedImplementation): typeof AnimatedMock);\n\nexport default {\n  FlatList,\n  Image,\n  ScrollView,\n  SectionList,\n  Text,\n  View,\n  ...Animated,\n};\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/AnimatedEvent.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport AnimatedValue from './nodes/AnimatedValue';\nimport NativeAnimatedHelper from './NativeAnimatedHelper';\n\nimport invariant from 'fbjs/lib/invariant';\n\nimport {shouldUseNativeDriver}from  './NativeAnimatedHelper';\n\nexport type Mapping = {[key: string]: Mapping, ...} | AnimatedValue;\nexport type EventConfig = {\n  listener?: ?Function,\n  useNativeDriver: boolean,\n};\n\nconst __DEV__ = process.env.NODE_ENV !== 'production';\n\nexport function attachNativeEvent(\n  viewRef: any,\n  eventName: string,\n  argMapping: $ReadOnlyArray<?Mapping>,\n): {detach: () => void} {\n  // Find animated values in `argMapping` and create an array representing their\n  // key path inside the `nativeEvent` object. Ex.: ['contentOffset', 'x'].\n  const eventMappings = [];\n\n  const traverse = (value, path) => {\n    if (value instanceof AnimatedValue) {\n      value.__makeNative();\n\n      eventMappings.push({\n        nativeEventPath: path,\n        animatedValueTag: value.__getNativeTag(),\n      });\n    } else if (typeof value === 'object') {\n      for (const key in value) {\n        traverse(value[key], path.concat(key));\n      }\n    }\n  };\n\n  invariant(\n    argMapping[0] && argMapping[0].nativeEvent,\n    'Native driven events only support animated values contained inside `nativeEvent`.',\n  );\n\n  // Assume that the event containing `nativeEvent` is always the first argument.\n  traverse(argMapping[0].nativeEvent, []);\n\n  if (viewRef != null) {\n    eventMappings.forEach(mapping => {\n      NativeAnimatedHelper.API.addAnimatedEventToView(\n        viewRef,\n        eventName,\n        mapping,\n      );\n    });\n  }\n\n  return {\n    detach() {\n      if (viewRef != null) {\n        eventMappings.forEach(mapping => {\n          NativeAnimatedHelper.API.removeAnimatedEventFromView(\n            viewRef,\n            eventName,\n            // $FlowFixMe[incompatible-call]\n            mapping.animatedValueTag,\n          );\n        });\n      }\n    },\n  };\n}\n\nfunction validateMapping(argMapping, args) {\n  const validate = (recMapping, recEvt, key) => {\n    if (recMapping instanceof AnimatedValue) {\n      invariant(\n        typeof recEvt === 'number',\n        'Bad mapping of event key ' +\n          key +\n          ', should be number but got ' +\n          typeof recEvt,\n      );\n      return;\n    }\n    if (typeof recEvt === 'number') {\n      invariant(\n        recMapping instanceof AnimatedValue,\n        'Bad mapping of type ' +\n          typeof recMapping +\n          ' for key ' +\n          key +\n          ', event value must map to AnimatedValue',\n      );\n      return;\n    }\n    invariant(\n      typeof recMapping === 'object',\n      'Bad mapping of type ' + typeof recMapping + ' for key ' + key,\n    );\n    invariant(\n      typeof recEvt === 'object',\n      'Bad event of type ' + typeof recEvt + ' for key ' + key,\n    );\n    for (const mappingKey in recMapping) {\n      validate(recMapping[mappingKey], recEvt[mappingKey], mappingKey);\n    }\n  };\n\n  invariant(\n    args.length >= argMapping.length,\n    'Event has less arguments than mapping',\n  );\n  argMapping.forEach((mapping, idx) => {\n    validate(mapping, args[idx], 'arg' + idx);\n  });\n}\n\nexport class AnimatedEvent {\n  _argMapping: $ReadOnlyArray<?Mapping>;\n  _listeners: Array<Function> = [];\n  _callListeners: Function;\n  _attachedEvent: ?{detach: () => void, ...};\n  __isNative: boolean;\n\n  constructor(argMapping: $ReadOnlyArray<?Mapping>, config: EventConfig) {\n    this._argMapping = argMapping;\n\n    if (config == null) {\n      console.warn('Animated.event now requires a second argument for options');\n      config = {useNativeDriver: false};\n    }\n\n    if (config.listener) {\n      this.__addListener(config.listener);\n    }\n    this._callListeners = this._callListeners.bind(this);\n    this._attachedEvent = null;\n    this.__isNative = shouldUseNativeDriver(config);\n  }\n\n  __addListener(callback: Function): void {\n    this._listeners.push(callback);\n  }\n\n  __removeListener(callback: Function): void {\n    this._listeners = this._listeners.filter(listener => listener !== callback);\n  }\n\n  __attach(viewRef: any, eventName: string) {\n    invariant(\n      this.__isNative,\n      'Only native driven events need to be attached.',\n    );\n\n    this._attachedEvent = attachNativeEvent(\n      viewRef,\n      eventName,\n      this._argMapping,\n    );\n  }\n\n  __detach(viewTag: any, eventName: string) {\n    invariant(\n      this.__isNative,\n      'Only native driven events need to be detached.',\n    );\n\n    this._attachedEvent && this._attachedEvent.detach();\n  }\n\n  __getHandler(): ((...args: any) => void) {\n    if (this.__isNative) {\n      if (__DEV__) {\n        let validatedMapping = false;\n        return (...args: any) => {\n          if (!validatedMapping) {\n            validateMapping(this._argMapping, args);\n            validatedMapping = true;\n          }\n          this._callListeners(...args);\n        };\n      } else {\n        return this._callListeners;\n      }\n    }\n\n    let validatedMapping = false;\n    return (...args: any) => {\n      if (__DEV__ && !validatedMapping) {\n        validateMapping(this._argMapping, args);\n        validatedMapping = true;\n      }\n\n      const traverse = (recMapping, recEvt, key) => {\n        if (recMapping instanceof AnimatedValue) {\n          if (typeof recEvt === 'number') {\n            recMapping.setValue(recEvt);\n          }\n        } else if (typeof recMapping === 'object') {\n          for (const mappingKey in recMapping) {\n            /* $FlowFixMe(>=0.120.0) This comment suppresses an error found\n             * when Flow v0.120 was deployed. To see the error, delete this\n             * comment and run Flow. */\n            traverse(recMapping[mappingKey], recEvt[mappingKey], mappingKey);\n          }\n        }\n      };\n      this._argMapping.forEach((mapping, idx) => {\n        traverse(mapping, args[idx], 'arg' + idx);\n      });\n\n      this._callListeners(...args);\n    };\n  }\n\n  _callListeners(...args: any) {\n    this._listeners.forEach(listener => listener(...args));\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/AnimatedImplementation.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport {AnimatedEvent, attachNativeEvent} from './AnimatedEvent';\nimport AnimatedAddition from './nodes/AnimatedAddition';\nimport AnimatedDiffClamp from './nodes/AnimatedDiffClamp';\nimport AnimatedDivision from './nodes/AnimatedDivision';\nimport AnimatedInterpolation from './nodes/AnimatedInterpolation';\nimport AnimatedModulo from './nodes/AnimatedModulo';\nimport AnimatedMultiplication from './nodes/AnimatedMultiplication';\nimport AnimatedNode from './nodes/AnimatedNode';\nimport AnimatedProps from './nodes/AnimatedProps';\nimport AnimatedSubtraction from './nodes/AnimatedSubtraction';\nimport AnimatedTracking from './nodes/AnimatedTracking';\nimport AnimatedValue from './nodes/AnimatedValue';\nimport AnimatedValueXY from './nodes/AnimatedValueXY';\nimport DecayAnimation from './animations/DecayAnimation';\nimport SpringAnimation from './animations/SpringAnimation';\nimport TimingAnimation from './animations/TimingAnimation';\n\nimport createAnimatedComponent from './createAnimatedComponent';\n\nimport type {\n  AnimationConfig,\n  EndCallback,\n  EndResult,\n} from './animations/Animation';\nimport type {TimingAnimationConfig} from './animations/TimingAnimation';\nimport type {DecayAnimationConfig} from './animations/DecayAnimation';\nimport type {SpringAnimationConfig} from './animations/SpringAnimation';\nimport type {Mapping, EventConfig} from './AnimatedEvent';\n\nimport AnimatedColor from './nodes/AnimatedColor';\n\nexport type CompositeAnimation = {\n  start: (callback?: ?EndCallback) => void,\n  stop: () => void,\n  reset: () => void,\n  _startNativeLoop: (iterations?: number) => void,\n  _isUsingNativeDriver: () => boolean,\n  ...\n};\n\nconst add = function (\n  a: AnimatedNode | number,\n  b: AnimatedNode | number,\n): AnimatedAddition {\n  return new AnimatedAddition(a, b);\n};\n\nconst subtract = function (\n  a: AnimatedNode | number,\n  b: AnimatedNode | number,\n): AnimatedSubtraction {\n  return new AnimatedSubtraction(a, b);\n};\n\nconst divide = function (\n  a: AnimatedNode | number,\n  b: AnimatedNode | number,\n): AnimatedDivision {\n  return new AnimatedDivision(a, b);\n};\n\nconst multiply = function (\n  a: AnimatedNode | number,\n  b: AnimatedNode | number,\n): AnimatedMultiplication {\n  return new AnimatedMultiplication(a, b);\n};\n\nconst modulo = function (a: AnimatedNode, modulus: number): AnimatedModulo {\n  return new AnimatedModulo(a, modulus);\n};\n\nconst diffClamp = function (\n  a: AnimatedNode,\n  min: number,\n  max: number,\n): AnimatedDiffClamp {\n  return new AnimatedDiffClamp(a, min, max);\n};\n\nconst _combineCallbacks = function (\n  callback: ?EndCallback,\n  config: $ReadOnly<{...AnimationConfig, ...}>,\n) {\n  if (callback && config.onComplete) {\n    return (...args: Array<EndResult>) => {\n      config.onComplete && config.onComplete(...args);\n      callback && callback(...args);\n    };\n  } else {\n    return callback || config.onComplete;\n  }\n};\n\nconst maybeVectorAnim = function (\n  value: AnimatedValue | AnimatedValueXY | AnimatedColor,\n  config: Object,\n  anim: (value: AnimatedValue, config: Object) => CompositeAnimation,\n): ?CompositeAnimation {\n  if (value instanceof AnimatedValueXY) {\n    const configX = {...config};\n    const configY = {...config};\n    for (const key in config) {\n      const {x, y} = config[key];\n      if (x !== undefined && y !== undefined) {\n        configX[key] = x;\n        configY[key] = y;\n      }\n    }\n    const aX = anim((value: AnimatedValueXY).x, configX);\n    const aY = anim((value: AnimatedValueXY).y, configY);\n    // We use `stopTogether: false` here because otherwise tracking will break\n    // because the second animation will get stopped before it can update.\n    return parallel([aX, aY], {stopTogether: false});\n  } else if (value instanceof AnimatedColor) {\n    const configR = {...config};\n    const configG = {...config};\n    const configB = {...config};\n    const configA = {...config};\n    for (const key in config) {\n      const {r, g, b, a} = config[key];\n      if (\n        r !== undefined &&\n        g !== undefined &&\n        b !== undefined &&\n        a !== undefined\n      ) {\n        configR[key] = r;\n        configG[key] = g;\n        configB[key] = b;\n        configA[key] = a;\n      }\n    }\n    const aR = anim((value: AnimatedColor).r, configR);\n    const aG = anim((value: AnimatedColor).g, configG);\n    const aB = anim((value: AnimatedColor).b, configB);\n    const aA = anim((value: AnimatedColor).a, configA);\n    // We use `stopTogether: false` here because otherwise tracking will break\n    // because the second animation will get stopped before it can update.\n    return parallel([aR, aG, aB, aA], {stopTogether: false});\n  }\n  return null;\n};\n\nconst spring = function (\n  value: AnimatedValue | AnimatedValueXY | AnimatedColor,\n  config: SpringAnimationConfig,\n): CompositeAnimation {\n  const start = function (\n    animatedValue: AnimatedValue | AnimatedValueXY | AnimatedColor,\n    configuration: SpringAnimationConfig,\n    callback?: ?EndCallback,\n  ): void {\n    callback = _combineCallbacks(callback, configuration);\n    const singleValue: any = animatedValue;\n    const singleConfig: any = configuration;\n    singleValue.stopTracking();\n    if (configuration.toValue instanceof AnimatedNode) {\n      singleValue.track(\n        new AnimatedTracking(\n          singleValue,\n          configuration.toValue,\n          SpringAnimation,\n          singleConfig,\n          callback,\n        ),\n      );\n    } else {\n      singleValue.animate(new SpringAnimation(singleConfig), callback);\n    }\n  };\n  return (\n    maybeVectorAnim(value, config, spring) || {\n      start: function (callback?: ?EndCallback): void {\n        start(value, config, callback);\n      },\n\n      stop: function (): void {\n        value.stopAnimation();\n      },\n\n      reset: function (): void {\n        value.resetAnimation();\n      },\n\n      _startNativeLoop: function (iterations?: number): void {\n        const singleConfig = {...config, iterations};\n        start(value, singleConfig);\n      },\n\n      _isUsingNativeDriver: function (): boolean {\n        return config.useNativeDriver || false;\n      },\n    }\n  );\n};\n\nconst timing = function (\n  value: AnimatedValue | AnimatedValueXY | AnimatedColor,\n  config: TimingAnimationConfig,\n): CompositeAnimation {\n  const start = function (\n    animatedValue: AnimatedValue | AnimatedValueXY | AnimatedColor,\n    configuration: TimingAnimationConfig,\n    callback?: ?EndCallback,\n  ): void {\n    callback = _combineCallbacks(callback, configuration);\n    const singleValue: any = animatedValue;\n    const singleConfig: any = configuration;\n    singleValue.stopTracking();\n    if (configuration.toValue instanceof AnimatedNode) {\n      singleValue.track(\n        new AnimatedTracking(\n          singleValue,\n          configuration.toValue,\n          TimingAnimation,\n          singleConfig,\n          callback,\n        ),\n      );\n    } else {\n      singleValue.animate(new TimingAnimation(singleConfig), callback);\n    }\n  };\n\n  return (\n    maybeVectorAnim(value, config, timing) || {\n      start: function (callback?: ?EndCallback): void {\n        start(value, config, callback);\n      },\n\n      stop: function (): void {\n        value.stopAnimation();\n      },\n\n      reset: function (): void {\n        value.resetAnimation();\n      },\n\n      _startNativeLoop: function (iterations?: number): void {\n        const singleConfig = {...config, iterations};\n        start(value, singleConfig);\n      },\n\n      _isUsingNativeDriver: function (): boolean {\n        return config.useNativeDriver || false;\n      },\n    }\n  );\n};\n\nconst decay = function (\n  value: AnimatedValue | AnimatedValueXY | AnimatedColor,\n  config: DecayAnimationConfig,\n): CompositeAnimation {\n  const start = function (\n    animatedValue: AnimatedValue | AnimatedValueXY | AnimatedColor,\n    configuration: DecayAnimationConfig,\n    callback?: ?EndCallback,\n  ): void {\n    callback = _combineCallbacks(callback, configuration);\n    const singleValue: any = animatedValue;\n    const singleConfig: any = configuration;\n    singleValue.stopTracking();\n    singleValue.animate(new DecayAnimation(singleConfig), callback);\n  };\n\n  return (\n    maybeVectorAnim(value, config, decay) || {\n      start: function (callback?: ?EndCallback): void {\n        start(value, config, callback);\n      },\n\n      stop: function (): void {\n        value.stopAnimation();\n      },\n\n      reset: function (): void {\n        value.resetAnimation();\n      },\n\n      _startNativeLoop: function (iterations?: number): void {\n        const singleConfig = {...config, iterations};\n        start(value, singleConfig);\n      },\n\n      _isUsingNativeDriver: function (): boolean {\n        return config.useNativeDriver || false;\n      },\n    }\n  );\n};\n\nconst sequence = function (\n  animations: Array<CompositeAnimation>,\n): CompositeAnimation {\n  let current = 0;\n  return {\n    start: function (callback?: ?EndCallback) {\n      const onComplete = function (result: EndResult) {\n        if (!result.finished) {\n          callback && callback(result);\n          return;\n        }\n\n        current++;\n\n        if (current === animations.length) {\n          // if the start is called, even without a reset, it should start from the beginning\n          current = 0;\n          callback && callback(result);\n          return;\n        }\n\n        animations[current].start(onComplete);\n      };\n\n      if (animations.length === 0) {\n        callback && callback({finished: true});\n      } else {\n        animations[current].start(onComplete);\n      }\n    },\n\n    stop: function () {\n      if (current < animations.length) {\n        animations[current].stop();\n      }\n    },\n\n    reset: function () {\n      animations.forEach((animation, idx) => {\n        if (idx <= current) {\n          animation.reset();\n        }\n      });\n      current = 0;\n    },\n\n    _startNativeLoop: function () {\n      throw new Error(\n        'Loops run using the native driver cannot contain Animated.sequence animations',\n      );\n    },\n\n    _isUsingNativeDriver: function (): boolean {\n      return false;\n    },\n  };\n};\n\ntype ParallelConfig = {\n  // If one is stopped, stop all.  default: true\n  stopTogether?: boolean,\n  ...\n};\nconst parallel = function (\n  animations: Array<CompositeAnimation>,\n  config?: ?ParallelConfig,\n): CompositeAnimation {\n  let doneCount = 0;\n  // Make sure we only call stop() at most once for each animation\n  const hasEnded = {};\n  const stopTogether = !(config && config.stopTogether === false);\n\n  const result = {\n    start: function (callback?: ?EndCallback) {\n      if (doneCount === animations.length) {\n        callback && callback({finished: true});\n        return;\n      }\n\n      animations.forEach((animation, idx) => {\n        const cb = function (endResult: EndResult | {finished: boolean}) {\n          hasEnded[idx] = true;\n          doneCount++;\n          if (doneCount === animations.length) {\n            doneCount = 0;\n            callback && callback(endResult);\n            return;\n          }\n\n          if (!endResult.finished && stopTogether) {\n            result.stop();\n          }\n        };\n\n        if (!animation) {\n          cb({finished: true});\n        } else {\n          animation.start(cb);\n        }\n      });\n    },\n\n    stop: function (): void {\n      animations.forEach((animation, idx) => {\n        !hasEnded[idx] && animation.stop();\n        hasEnded[idx] = true;\n      });\n    },\n\n    reset: function (): void {\n      animations.forEach((animation, idx) => {\n        animation.reset();\n        hasEnded[idx] = false;\n        doneCount = 0;\n      });\n    },\n\n    _startNativeLoop: function () {\n      throw new Error(\n        'Loops run using the native driver cannot contain Animated.parallel animations',\n      );\n    },\n\n    _isUsingNativeDriver: function (): boolean {\n      return false;\n    },\n  };\n\n  return result;\n};\n\nconst delay = function (time: number): CompositeAnimation {\n  // Would be nice to make a specialized implementation\n  return timing(new AnimatedValue(0), {\n    toValue: 0,\n    delay: time,\n    duration: 0,\n    useNativeDriver: false,\n  });\n};\n\nconst stagger = function (\n  time: number,\n  animations: Array<CompositeAnimation>,\n): CompositeAnimation {\n  return parallel(\n    animations.map((animation, i) => {\n      return sequence([delay(time * i), animation]);\n    }),\n  );\n};\n\ntype LoopAnimationConfig = {\n  iterations: number,\n  resetBeforeIteration?: boolean,\n  ...\n};\n\nconst loop = function (\n  animation: CompositeAnimation,\n  // $FlowFixMe[prop-missing]\n  {iterations = -1, resetBeforeIteration = true}: LoopAnimationConfig = {},\n): CompositeAnimation {\n  let isFinished = false;\n  let iterationsSoFar = 0;\n  return {\n    start: function (callback?: ?EndCallback) {\n      const restart = function (result: EndResult = {finished: true}): void {\n        if (\n          isFinished ||\n          iterationsSoFar === iterations ||\n          result.finished === false\n        ) {\n          callback && callback(result);\n        } else {\n          iterationsSoFar++;\n          resetBeforeIteration && animation.reset();\n          animation.start(restart);\n        }\n      };\n      if (!animation || iterations === 0) {\n        callback && callback({finished: true});\n      } else {\n        if (animation._isUsingNativeDriver()) {\n          animation._startNativeLoop(iterations);\n        } else {\n          restart(); // Start looping recursively on the js thread\n        }\n      }\n    },\n\n    stop: function (): void {\n      isFinished = true;\n      animation.stop();\n    },\n\n    reset: function (): void {\n      iterationsSoFar = 0;\n      isFinished = false;\n      animation.reset();\n    },\n\n    _startNativeLoop: function () {\n      throw new Error(\n        'Loops run using the native driver cannot contain Animated.loop animations',\n      );\n    },\n\n    _isUsingNativeDriver: function (): boolean {\n      return animation._isUsingNativeDriver();\n    },\n  };\n};\n\nfunction forkEvent(\n  event: ?AnimatedEvent | ?Function,\n  listener: Function,\n): AnimatedEvent | Function {\n  if (!event) {\n    return listener;\n  } else if (event instanceof AnimatedEvent) {\n    event.__addListener(listener);\n    return event;\n  } else {\n    return (...args) => {\n      typeof event === 'function' && event(...args);\n      listener(...args);\n    };\n  }\n}\n\nfunction unforkEvent(\n  event: ?AnimatedEvent | ?Function,\n  listener: Function,\n): void {\n  if (event && event instanceof AnimatedEvent) {\n    event.__removeListener(listener);\n  }\n}\n\nconst event = function (\n  argMapping: $ReadOnlyArray<?Mapping>,\n  config: EventConfig,\n): any {\n  const animatedEvent = new AnimatedEvent(argMapping, config);\n  if (animatedEvent.__isNative) {\n    return animatedEvent;\n  } else {\n    return animatedEvent.__getHandler();\n  }\n};\n\n// All types of animated nodes that represent scalar numbers and can be interpolated (etc)\ntype AnimatedNumeric =\n  | AnimatedAddition\n  | AnimatedDiffClamp\n  | AnimatedDivision\n  | AnimatedInterpolation<number>\n  | AnimatedModulo\n  | AnimatedMultiplication\n  | AnimatedSubtraction\n  | AnimatedValue;\n\nexport type {AnimatedNumeric as Numeric};\n\n/**\n * The `Animated` library is designed to make animations fluid, powerful, and\n * easy to build and maintain. `Animated` focuses on declarative relationships\n * between inputs and outputs, with configurable transforms in between, and\n * simple `start`/`stop` methods to control time-based animation execution.\n * If additional transforms are added, be sure to include them in\n * AnimatedMock.js as well.\n *\n * See https://reactnative.dev/docs/animated\n */\nexport default {\n  /**\n   * Standard value class for driving animations.  Typically initialized with\n   * `new Animated.Value(0);`\n   *\n   * See https://reactnative.dev/docs/animated#value\n   */\n  Value: AnimatedValue,\n  /**\n   * 2D value class for driving 2D animations, such as pan gestures.\n   *\n   * See https://reactnative.dev/docs/animatedvaluexy\n   */\n  ValueXY: AnimatedValueXY,\n  /**\n   * Value class for driving color animations.\n   */\n  Color: AnimatedColor,\n  /**\n   * Exported to use the Interpolation type in flow.\n   *\n   * See https://reactnative.dev/docs/animated#interpolation\n   */\n  Interpolation: AnimatedInterpolation,\n  /**\n   * Exported for ease of type checking. All animated values derive from this\n   * class.\n   *\n   * See https://reactnative.dev/docs/animated#node\n   */\n  Node: AnimatedNode,\n\n  /**\n   * Animates a value from an initial velocity to zero based on a decay\n   * coefficient.\n   *\n   * See https://reactnative.dev/docs/animated#decay\n   */\n  decay,\n  /**\n   * Animates a value along a timed easing curve. The Easing module has tons of\n   * predefined curves, or you can use your own function.\n   *\n   * See https://reactnative.dev/docs/animated#timing\n   */\n  timing,\n  /**\n   * Animates a value according to an analytical spring model based on\n   * damped harmonic oscillation.\n   *\n   * See https://reactnative.dev/docs/animated#spring\n   */\n  spring,\n\n  /**\n   * Creates a new Animated value composed from two Animated values added\n   * together.\n   *\n   * See https://reactnative.dev/docs/animated#add\n   */\n  add,\n\n  /**\n   * Creates a new Animated value composed by subtracting the second Animated\n   * value from the first Animated value.\n   *\n   * See https://reactnative.dev/docs/animated#subtract\n   */\n  subtract,\n\n  /**\n   * Creates a new Animated value composed by dividing the first Animated value\n   * by the second Animated value.\n   *\n   * See https://reactnative.dev/docs/animated#divide\n   */\n  divide,\n\n  /**\n   * Creates a new Animated value composed from two Animated values multiplied\n   * together.\n   *\n   * See https://reactnative.dev/docs/animated#multiply\n   */\n  multiply,\n\n  /**\n   * Creates a new Animated value that is the (non-negative) modulo of the\n   * provided Animated value.\n   *\n   * See https://reactnative.dev/docs/animated#modulo\n   */\n  modulo,\n\n  /**\n   * Create a new Animated value that is limited between 2 values. It uses the\n   * difference between the last value so even if the value is far from the\n   * bounds it will start changing when the value starts getting closer again.\n   *\n   * See https://reactnative.dev/docs/animated#diffclamp\n   */\n  diffClamp,\n\n  /**\n   * Starts an animation after the given delay.\n   *\n   * See https://reactnative.dev/docs/animated#delay\n   */\n  delay,\n  /**\n   * Starts an array of animations in order, waiting for each to complete\n   * before starting the next. If the current running animation is stopped, no\n   * following animations will be started.\n   *\n   * See https://reactnative.dev/docs/animated#sequence\n   */\n  sequence,\n  /**\n   * Starts an array of animations all at the same time. By default, if one\n   * of the animations is stopped, they will all be stopped. You can override\n   * this with the `stopTogether` flag.\n   *\n   * See https://reactnative.dev/docs/animated#parallel\n   */\n  parallel,\n  /**\n   * Array of animations may run in parallel (overlap), but are started in\n   * sequence with successive delays.  Nice for doing trailing effects.\n   *\n   * See https://reactnative.dev/docs/animated#stagger\n   */\n  stagger,\n  /**\n   * Loops a given animation continuously, so that each time it reaches the\n   * end, it resets and begins again from the start.\n   *\n   * See https://reactnative.dev/docs/animated#loop\n   */\n  loop,\n\n  /**\n   * Takes an array of mappings and extracts values from each arg accordingly,\n   * then calls `setValue` on the mapped outputs.\n   *\n   * See https://reactnative.dev/docs/animated#event\n   */\n  event,\n\n  /**\n   * Make any React component Animatable.  Used to create `Animated.View`, etc.\n   *\n   * See https://reactnative.dev/docs/animated#createanimatedcomponent\n   */\n  createAnimatedComponent,\n\n  /**\n   * Imperative API to attach an animated value to an event on a view. Prefer\n   * using `Animated.event` with `useNativeDrive: true` if possible.\n   *\n   * See https://reactnative.dev/docs/animated#attachnativeevent\n   */\n  attachNativeEvent,\n\n  /**\n   * Advanced imperative API for snooping on animated events that are passed in\n   * through props. Use values directly where possible.\n   *\n   * See https://reactnative.dev/docs/animated#forkevent\n   */\n  forkEvent,\n  unforkEvent,\n\n  /**\n   * Expose Event class, so it can be used as a type for type checkers.\n   */\n  Event: AnimatedEvent,\n};\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/AnimatedMock.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport type {EndResult} from './animations/Animation';\n\nimport {AnimatedEvent, attachNativeEvent} from './AnimatedEvent';\nimport AnimatedImplementation from './AnimatedImplementation';\nimport AnimatedInterpolation from './nodes/AnimatedInterpolation';\nimport AnimatedNode from './nodes/AnimatedNode';\nimport AnimatedValue from './nodes/AnimatedValue';\nimport AnimatedValueXY from './nodes/AnimatedValueXY';\n\nimport createAnimatedComponent from './createAnimatedComponent';\n\nimport type {EndCallback} from './animations/Animation';\nimport type {TimingAnimationConfig} from './animations/TimingAnimation';\nimport type {DecayAnimationConfig} from './animations/DecayAnimation';\nimport type {SpringAnimationConfig} from './animations/SpringAnimation';\nimport type {Numeric as AnimatedNumeric} from './AnimatedImplementation';\nimport AnimatedColor from './nodes/AnimatedColor';\n\n/**\n * Animations are a source of flakiness in snapshot testing. This mock replaces\n * animation functions from AnimatedImplementation with empty animations for\n * predictability in tests. When possible the animation will run immediately\n * to the final state.\n */\n\n// Prevent any callback invocation from recursively triggering another\n// callback, which may trigger another animation\nlet inAnimationCallback = false;\nfunction mockAnimationStart(\n  start: (callback?: ?EndCallback) => void,\n): (callback?: ?EndCallback) => void {\n  return callback => {\n    const guardedCallback =\n      callback == null\n        ? callback\n        : (...args: Array<EndResult>) => {\n            if (inAnimationCallback) {\n              console.warn(\n                'Ignoring recursive animation callback when running mock animations',\n              );\n              return;\n            }\n            inAnimationCallback = true;\n            try {\n              callback(...args);\n            } finally {\n              inAnimationCallback = false;\n            }\n          };\n    start(guardedCallback);\n  };\n}\n\nexport type CompositeAnimation = {\n  start: (callback?: ?EndCallback) => void,\n  stop: () => void,\n  reset: () => void,\n  _startNativeLoop: (iterations?: number) => void,\n  _isUsingNativeDriver: () => boolean,\n  ...\n};\n\nconst emptyAnimation = {\n  start: () => {},\n  stop: () => {},\n  reset: () => {},\n  _startNativeLoop: () => {},\n  _isUsingNativeDriver: () => {\n    return false;\n  },\n};\n\nconst mockCompositeAnimation = (\n  animations: Array<CompositeAnimation>,\n): CompositeAnimation => ({\n  ...emptyAnimation,\n  start: mockAnimationStart((callback?: ?EndCallback): void => {\n    animations.forEach(animation => animation.start());\n    callback?.({finished: true});\n  }),\n});\n\nconst spring = function (\n  value: AnimatedValue | AnimatedValueXY | AnimatedColor,\n  config: SpringAnimationConfig,\n): CompositeAnimation {\n  const anyValue: any = value;\n  return {\n    ...emptyAnimation,\n    start: mockAnimationStart((callback?: ?EndCallback): void => {\n      anyValue.setValue(config.toValue);\n      callback?.({finished: true});\n    }),\n  };\n};\n\nconst timing = function (\n  value: AnimatedValue | AnimatedValueXY | AnimatedColor,\n  config: TimingAnimationConfig,\n): CompositeAnimation {\n  const anyValue: any = value;\n  return {\n    ...emptyAnimation,\n    start: mockAnimationStart((callback?: ?EndCallback): void => {\n      anyValue.setValue(config.toValue);\n      callback?.({finished: true});\n    }),\n  };\n};\n\nconst decay = function (\n  value: AnimatedValue | AnimatedValueXY | AnimatedColor,\n  config: DecayAnimationConfig,\n): CompositeAnimation {\n  return emptyAnimation;\n};\n\nconst sequence = function (\n  animations: Array<CompositeAnimation>,\n): CompositeAnimation {\n  return mockCompositeAnimation(animations);\n};\n\ntype ParallelConfig = {stopTogether?: boolean, ...};\nconst parallel = function (\n  animations: Array<CompositeAnimation>,\n  config?: ?ParallelConfig,\n): CompositeAnimation {\n  return mockCompositeAnimation(animations);\n};\n\nconst delay = function (time: number): CompositeAnimation {\n  return emptyAnimation;\n};\n\nconst stagger = function (\n  time: number,\n  animations: Array<CompositeAnimation>,\n): CompositeAnimation {\n  return mockCompositeAnimation(animations);\n};\n\ntype LoopAnimationConfig = {\n  iterations: number,\n  resetBeforeIteration?: boolean,\n  ...\n};\n\nconst loop = function (\n  animation: CompositeAnimation,\n  // $FlowFixMe[prop-missing]\n  {iterations = -1}: LoopAnimationConfig = {},\n): CompositeAnimation {\n  return emptyAnimation;\n};\n\nexport type {AnimatedNumeric as Numeric};\n\nexport default {\n  Value: AnimatedValue,\n  ValueXY: AnimatedValueXY,\n  Color: AnimatedColor,\n  Interpolation: AnimatedInterpolation,\n  Node: AnimatedNode,\n  decay,\n  timing,\n  spring,\n  add: AnimatedImplementation.add,\n  subtract: AnimatedImplementation.subtract,\n  divide: AnimatedImplementation.divide,\n  multiply: AnimatedImplementation.multiply,\n  modulo: AnimatedImplementation.modulo,\n  diffClamp: AnimatedImplementation.diffClamp,\n  delay,\n  sequence,\n  parallel,\n  stagger,\n  loop,\n  event: AnimatedImplementation.event,\n  createAnimatedComponent,\n  attachNativeEvent,\n  forkEvent: AnimatedImplementation.forkEvent,\n  unforkEvent: AnimatedImplementation.unforkEvent,\n  Event: AnimatedEvent,\n};\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/AnimatedPlatformConfig.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nexport type PlatformConfig = {};\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/Easing.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * @flow strict\n */\n\n'use strict';\n\nimport _bezier from './bezier';\n\nlet ease;\n\n/**\n * The `Easing` module implements common easing functions. This module is used\n * by [Animate.timing()](docs/animate.html#timing) to convey physically\n * believable motion in animations.\n *\n * You can find a visualization of some common easing functions at\n * http://easings.net/\n *\n * ### Predefined animations\n *\n * The `Easing` module provides several predefined animations through the\n * following methods:\n *\n * - [`back`](docs/easing.html#back) provides a simple animation where the\n *   object goes slightly back before moving forward\n * - [`bounce`](docs/easing.html#bounce) provides a bouncing animation\n * - [`ease`](docs/easing.html#ease) provides a simple inertial animation\n * - [`elastic`](docs/easing.html#elastic) provides a simple spring interaction\n *\n * ### Standard functions\n *\n * Three standard easing functions are provided:\n *\n * - [`linear`](docs/easing.html#linear)\n * - [`quad`](docs/easing.html#quad)\n * - [`cubic`](docs/easing.html#cubic)\n *\n * The [`poly`](docs/easing.html#poly) function can be used to implement\n * quartic, quintic, and other higher power functions.\n *\n * ### Additional functions\n *\n * Additional mathematical functions are provided by the following methods:\n *\n * - [`bezier`](docs/easing.html#bezier) provides a cubic bezier curve\n * - [`circle`](docs/easing.html#circle) provides a circular function\n * - [`sin`](docs/easing.html#sin) provides a sinusoidal function\n * - [`exp`](docs/easing.html#exp) provides an exponential function\n *\n * The following helpers are used to modify other easing functions.\n *\n * - [`in`](docs/easing.html#in) runs an easing function forwards\n * - [`inOut`](docs/easing.html#inout) makes any easing function symmetrical\n * - [`out`](docs/easing.html#out) runs an easing function backwards\n */\nclass Easing {\n  /**\n   * A stepping function, returns 1 for any positive value of `n`.\n   */\n  static step0(n: number): number {\n    return n > 0 ? 1 : 0;\n  }\n\n  /**\n   * A stepping function, returns 1 if `n` is greater than or equal to 1.\n   */\n  static step1(n: number): number {\n    return n >= 1 ? 1 : 0;\n  }\n\n  /**\n   * A linear function, `f(t) = t`. Position correlates to elapsed time one to\n   * one.\n   *\n   * http://cubic-bezier.com/#0,0,1,1\n   */\n  static linear(t: number): number {\n    return t;\n  }\n\n  /**\n   * A simple inertial interaction, similar to an object slowly accelerating to\n   * speed.\n   *\n   * http://cubic-bezier.com/#.42,0,1,1\n   */\n  static ease(t: number): number {\n    if (!ease) {\n      ease = Easing.bezier(0.42, 0, 1, 1);\n    }\n    return ease(t);\n  }\n\n  /**\n   * A quadratic function, `f(t) = t * t`. Position equals the square of elapsed\n   * time.\n   *\n   * http://easings.net/#easeInQuad\n   */\n  static quad(t: number): number {\n    return t * t;\n  }\n\n  /**\n   * A cubic function, `f(t) = t * t * t`. Position equals the cube of elapsed\n   * time.\n   *\n   * http://easings.net/#easeInCubic\n   */\n  static cubic(t: number): number {\n    return t * t * t;\n  }\n\n  /**\n   * A power function. Position is equal to the Nth power of elapsed time.\n   *\n   * n = 4: http://easings.net/#easeInQuart\n   * n = 5: http://easings.net/#easeInQuint\n   */\n  static poly(n: number): (t: number) => number {\n    return (t: number) => Math.pow(t, n);\n  }\n\n  /**\n   * A sinusoidal function.\n   *\n   * http://easings.net/#easeInSine\n   */\n  static sin(t: number): number {\n    return 1 - Math.cos((t * Math.PI) / 2);\n  }\n\n  /**\n   * A circular function.\n   *\n   * http://easings.net/#easeInCirc\n   */\n  static circle(t: number): number {\n    return 1 - Math.sqrt(1 - t * t);\n  }\n\n  /**\n   * An exponential function.\n   *\n   * http://easings.net/#easeInExpo\n   */\n  static exp(t: number): number {\n    return Math.pow(2, 10 * (t - 1));\n  }\n\n  /**\n   * A simple elastic interaction, similar to a spring oscillating back and\n   * forth.\n   *\n   * Default bounciness is 1, which overshoots a little bit once. 0 bounciness\n   * doesn't overshoot at all, and bounciness of N > 1 will overshoot about N\n   * times.\n   *\n   * http://easings.net/#easeInElastic\n   */\n  static elastic(bounciness: number = 1): (t: number) => number {\n    const p = bounciness * Math.PI;\n    return t => 1 - Math.pow(Math.cos((t * Math.PI) / 2), 3) * Math.cos(t * p);\n  }\n\n  /**\n   * Use with `Animated.parallel()` to create a simple effect where the object\n   * animates back slightly as the animation starts.\n   *\n   * Wolfram Plot:\n   *\n   * - http://tiny.cc/back_default (s = 1.70158, default)\n   */\n  static back(s: number = 1.70158): (t: number) => number {\n    return t => t * t * ((s + 1) * t - s);\n  }\n\n  /**\n   * Provides a simple bouncing effect.\n   *\n   * http://easings.net/#easeInBounce\n   */\n  static bounce(t: number): number {\n    if (t < 1 / 2.75) {\n      return 7.5625 * t * t;\n    }\n\n    if (t < 2 / 2.75) {\n      const t2 = t - 1.5 / 2.75;\n      return 7.5625 * t2 * t2 + 0.75;\n    }\n\n    if (t < 2.5 / 2.75) {\n      const t2 = t - 2.25 / 2.75;\n      return 7.5625 * t2 * t2 + 0.9375;\n    }\n\n    const t2 = t - 2.625 / 2.75;\n    return 7.5625 * t2 * t2 + 0.984375;\n  }\n\n  /**\n   * Provides a cubic bezier curve, equivalent to CSS Transitions'\n   * `transition-timing-function`.\n   *\n   * A useful tool to visualize cubic bezier curves can be found at\n   * http://cubic-bezier.com/\n   */\n  static bezier(\n    x1: number,\n    y1: number,\n    x2: number,\n    y2: number,\n  ): (t: number) => number {\n    return _bezier(x1, y1, x2, y2);\n  }\n\n  /**\n   * Runs an easing function forwards.\n   */\n  static in(easing: (t: number) => number): (t: number) => number {\n    return easing;\n  }\n\n  /**\n   * Runs an easing function backwards.\n   */\n  static out(easing: (t: number) => number): (t: number) => number {\n    return t => 1 - easing(1 - t);\n  }\n\n  /**\n   * Makes any easing function symmetrical. The easing function will run\n   * forwards for half of the duration, then backwards for the rest of the\n   * duration.\n   */\n  static inOut(easing: (t: number) => number): (t: number) => number {\n    return t => {\n      if (t < 0.5) {\n        return easing(t * 2) / 2;\n      }\n      return 1 - easing((1 - t) * 2) / 2;\n    };\n  }\n}\n\nexport default Easing;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/NativeAnimatedHelper.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\nimport NativeAnimatedNonTurboModule from './NativeAnimatedModule';\nimport NativeAnimatedTurboModule from './NativeAnimatedTurboModule';\nimport NativeEventEmitter from '../EventEmitter/NativeEventEmitter';\nimport Platform from '../Utilities/Platform';\nimport type {EventConfig} from './AnimatedEvent';\nimport type {\n  EventMapping,\n  AnimatedNodeConfig,\n  AnimatingNodeConfig,\n} from './NativeAnimatedModule';\nimport type {AnimationConfig, EndCallback} from './animations/Animation';\nimport type {InterpolationConfigType} from './nodes/AnimatedInterpolation';\nimport ReactNativeFeatureFlags from '../ReactNative/ReactNativeFeatureFlags';\nimport invariant from 'fbjs/lib/invariant';\nimport RCTDeviceEventEmitter from '../EventEmitter/RCTDeviceEventEmitter';\nimport type {EventSubscription} from '../vendor/emitter/EventEmitter';\n\n// TODO T69437152 @petetheheat - Delete this fork when Fabric ships to 100%.\nconst NativeAnimatedModule =\n  Platform.OS === 'ios' && global.RN$Bridgeless === true\n    ? NativeAnimatedTurboModule\n    : NativeAnimatedNonTurboModule;\n\nlet __nativeAnimatedNodeTagCount = 1; /* used for animated nodes */\nlet __nativeAnimationIdCount = 1; /* used for started animations */\n\nlet nativeEventEmitter;\n\nlet waitingForQueuedOperations = new Set();\nlet queueOperations = false;\nlet queue: Array<() => void> = [];\n// $FlowFixMe\nlet singleOpQueue: Array<any> = [];\n\nconst useSingleOpBatching = false;\n  Platform.OS === 'android' &&\n  !!NativeAnimatedModule?.queueAndExecuteBatchedOperations &&\n  ReactNativeFeatureFlags.animatedShouldUseSingleOp();\nlet flushQueueTimeout = null;\n\nconst eventListenerGetValueCallbacks = {};\nconst eventListenerAnimationFinishedCallbacks = {};\nlet globalEventEmitterGetValueListener: ?EventSubscription = null;\nlet globalEventEmitterAnimationFinishedListener: ?EventSubscription = null;\n\nconst nativeOps: ?typeof NativeAnimatedModule = useSingleOpBatching\n  ? ((function () {\n      const apis = [\n        'createAnimatedNode', // 1\n        'updateAnimatedNodeConfig', // 2\n        'getValue', // 3\n        'startListeningToAnimatedNodeValue', // 4\n        'stopListeningToAnimatedNodeValue', // 5\n        'connectAnimatedNodes', // 6\n        'disconnectAnimatedNodes', // 7\n        'startAnimatingNode', // 8\n        'stopAnimation', // 9\n        'setAnimatedNodeValue', // 10\n        'setAnimatedNodeOffset', // 11\n        'flattenAnimatedNodeOffset', // 12\n        'extractAnimatedNodeOffset', // 13\n        'connectAnimatedNodeToView', // 14\n        'disconnectAnimatedNodeFromView', // 15\n        'restoreDefaultValues', // 16\n        'dropAnimatedNode', // 17\n        'addAnimatedEventToView', // 18\n        'removeAnimatedEventFromView', // 19\n        'addListener', // 20\n        'removeListener', // 21\n      ];\n      return apis.reduce((acc, functionName, i) => {\n        // These indices need to be kept in sync with the indices in native (see NativeAnimatedModule in Java, or the equivalent for any other native platform).\n        // $FlowFixMe[prop-missing]\n        acc[functionName] = i + 1;\n        return acc;\n      }, {});\n    })(): $FlowFixMe)\n  : NativeAnimatedModule;\n\n/**\n * Wrappers around NativeAnimatedModule to provide flow and autocomplete support for\n * the native module methods, and automatic queue management on Android\n */\nconst API = {\n  getValue: function (\n    tag: number,\n    saveValueCallback: (value: number) => void,\n  ): void {\n    invariant(nativeOps, 'Native animated module is not available');\n    if (useSingleOpBatching) {\n      if (saveValueCallback) {\n        eventListenerGetValueCallbacks[tag] = saveValueCallback;\n      }\n      // $FlowFixMe\n      API.queueOperation(nativeOps.getValue, tag);\n    } else {\n      API.queueOperation(nativeOps.getValue, tag, saveValueCallback);\n    }\n  },\n  setWaitingForIdentifier: function (id: string): void {\n    waitingForQueuedOperations.add(id);\n    queueOperations = true;\n    if (\n      ReactNativeFeatureFlags.animatedShouldDebounceQueueFlush() &&\n      flushQueueTimeout\n    ) {\n      clearTimeout(flushQueueTimeout);\n    }\n  },\n  unsetWaitingForIdentifier: function (id: string): void {\n    waitingForQueuedOperations.delete(id);\n\n    if (waitingForQueuedOperations.size === 0) {\n      queueOperations = false;\n      API.disableQueue();\n    }\n  },\n  disableQueue: function (): void {\n    invariant(nativeOps, 'Native animated module is not available');\n\n    if (ReactNativeFeatureFlags.animatedShouldDebounceQueueFlush()) {\n      const prevTimeout = flushQueueTimeout;\n      clearImmediate(prevTimeout);\n      flushQueueTimeout = setImmediate(API.flushQueue);\n    } else {\n      API.flushQueue();\n    }\n  },\n  flushQueue: function (): void {\n    /*\n    invariant(NativeAnimatedModule, 'Native animated module is not available');\n    flushQueueTimeout = null;\n\n    // Early returns before calling any APIs\n    if (useSingleOpBatching && singleOpQueue.length === 0) {\n      return;\n    }\n    if (!useSingleOpBatching && queue.length === 0) {\n      return;\n    }\n\n    if (useSingleOpBatching) {\n      // Set up event listener for callbacks if it's not set up\n      if (\n        !globalEventEmitterGetValueListener ||\n        !globalEventEmitterAnimationFinishedListener\n      ) {\n        setupGlobalEventEmitterListeners();\n      }\n      // Single op batching doesn't use callback functions, instead we\n      // use RCTDeviceEventEmitter. This reduces overhead of sending lots of\n      // JSI functions across to native code; but also, TM infrastructure currently\n      // does not support packing a function into native arrays.\n      NativeAnimatedModule.queueAndExecuteBatchedOperations?.(singleOpQueue);\n      singleOpQueue.length = 0;\n    } else {\n      Platform.OS === 'android' && NativeAnimatedModule.startOperationBatch?.();\n      for (let q = 0, l = queue.length; q < l; q++) {\n        queue[q]();\n      }\n      queue.length = 0;\n      Platform.OS === 'android' &&\n        NativeAnimatedModule.finishOperationBatch?.();\n    }\n    */\n  },\n  queueOperation: <Args: $ReadOnlyArray<mixed>, Fn: (...Args) => void>(\n    fn: Fn,\n    ...args: Args\n  ): void => {\n    if (useSingleOpBatching) {\n      // Get the command ID from the queued function, and push that ID and any arguments needed to execute the operation\n      // $FlowFixMe: surprise, fn is actually a number\n      singleOpQueue.push(fn, ...args);\n      return;\n    }\n\n    // If queueing is explicitly on, *or* the queue has not yet\n    // been flushed, use the queue. This is to prevent operations\n    // from being executed out of order.\n    if (queueOperations || queue.length !== 0) {\n      queue.push(() => fn(...args));\n    } else {\n      fn(...args);\n    }\n  },\n  createAnimatedNode: function (tag: number, config: AnimatedNodeConfig): void {\n    invariant(nativeOps, 'Native animated module is not available');\n    API.queueOperation(nativeOps.createAnimatedNode, tag, config);\n  },\n  updateAnimatedNodeConfig: function (\n    tag: number,\n    config: AnimatedNodeConfig,\n  ): void {\n    invariant(nativeOps, 'Native animated module is not available');\n    //if (nativeOps.updateAnimatedNodeConfig) {\n    //  API.queueOperation(nativeOps.updateAnimatedNodeConfig, tag, config);\n    //}\n  },\n  startListeningToAnimatedNodeValue: function (tag: number) {\n    invariant(nativeOps, 'Native animated module is not available');\n    API.queueOperation(nativeOps.startListeningToAnimatedNodeValue, tag);\n  },\n  stopListeningToAnimatedNodeValue: function (tag: number) {\n    invariant(nativeOps, 'Native animated module is not available');\n    API.queueOperation(nativeOps.stopListeningToAnimatedNodeValue, tag);\n  },\n  connectAnimatedNodes: function (parentTag: number, childTag: number): void {\n    invariant(nativeOps, 'Native animated module is not available');\n    API.queueOperation(nativeOps.connectAnimatedNodes, parentTag, childTag);\n  },\n  disconnectAnimatedNodes: function (\n    parentTag: number,\n    childTag: number,\n  ): void {\n    invariant(nativeOps, 'Native animated module is not available');\n    API.queueOperation(nativeOps.disconnectAnimatedNodes, parentTag, childTag);\n  },\n  startAnimatingNode: function (\n    animationId: number,\n    nodeTag: number,\n    config: AnimatingNodeConfig,\n    endCallback: EndCallback,\n  ): void {\n    invariant(nativeOps, 'Native animated module is not available');\n    if (useSingleOpBatching) {\n      if (endCallback) {\n        eventListenerAnimationFinishedCallbacks[animationId] = endCallback;\n      }\n      // $FlowFixMe\n      API.queueOperation(\n        nativeOps.startAnimatingNode,\n        animationId,\n        nodeTag,\n        config,\n      );\n    } else {\n      API.queueOperation(\n        nativeOps.startAnimatingNode,\n        animationId,\n        nodeTag,\n        config,\n        endCallback,\n      );\n    }\n  },\n  stopAnimation: function (animationId: number) {\n    invariant(nativeOps, 'Native animated module is not available');\n    API.queueOperation(nativeOps.stopAnimation, animationId);\n  },\n  setAnimatedNodeValue: function (nodeTag: number, value: number): void {\n    invariant(nativeOps, 'Native animated module is not available');\n    API.queueOperation(nativeOps.setAnimatedNodeValue, nodeTag, value);\n  },\n  setAnimatedNodeOffset: function (nodeTag: number, offset: number): void {\n    invariant(nativeOps, 'Native animated module is not available');\n    API.queueOperation(nativeOps.setAnimatedNodeOffset, nodeTag, offset);\n  },\n  flattenAnimatedNodeOffset: function (nodeTag: number): void {\n    invariant(nativeOps, 'Native animated module is not available');\n    API.queueOperation(nativeOps.flattenAnimatedNodeOffset, nodeTag);\n  },\n  extractAnimatedNodeOffset: function (nodeTag: number): void {\n    invariant(nativeOps, 'Native animated module is not available');\n    API.queueOperation(nativeOps.extractAnimatedNodeOffset, nodeTag);\n  },\n  connectAnimatedNodeToView: function (nodeTag: number, viewTag: number): void {\n    invariant(nativeOps, 'Native animated module is not available');\n    API.queueOperation(nativeOps.connectAnimatedNodeToView, nodeTag, viewTag);\n  },\n  disconnectAnimatedNodeFromView: function (\n    nodeTag: number,\n    viewTag: number,\n  ): void {\n    invariant(nativeOps, 'Native animated module is not available');\n    API.queueOperation(\n      nativeOps.disconnectAnimatedNodeFromView,\n      nodeTag,\n      viewTag,\n    );\n  },\n  restoreDefaultValues: function (nodeTag: number): void {\n    invariant(nativeOps, 'Native animated module is not available');\n    // Backwards compat with older native runtimes, can be removed later.\n    if (nativeOps.restoreDefaultValues != null) {\n      API.queueOperation(nativeOps.restoreDefaultValues, nodeTag);\n    }\n  },\n  dropAnimatedNode: function (tag: number): void {\n    invariant(nativeOps, 'Native animated module is not available');\n    API.queueOperation(nativeOps.dropAnimatedNode, tag);\n  },\n  addAnimatedEventToView: function (\n    viewTag: number,\n    eventName: string,\n    eventMapping: EventMapping,\n  ) {\n    invariant(nativeOps, 'Native animated module is not available');\n    API.queueOperation(\n      nativeOps.addAnimatedEventToView,\n      viewTag,\n      eventName,\n      eventMapping,\n    );\n  },\n  removeAnimatedEventFromView(\n    viewTag: number,\n    eventName: string,\n    animatedNodeTag: number,\n  ) {\n    invariant(nativeOps, 'Native animated module is not available');\n    API.queueOperation(\n      nativeOps.removeAnimatedEventFromView,\n      viewTag,\n      eventName,\n      animatedNodeTag,\n    );\n  },\n};\n\nfunction setupGlobalEventEmitterListeners() {\n  globalEventEmitterGetValueListener = RCTDeviceEventEmitter.addListener(\n    'onNativeAnimatedModuleGetValue',\n    function (params) {\n      const {tag} = params;\n      const callback = eventListenerGetValueCallbacks[tag];\n      if (!callback) {\n        return;\n      }\n      callback(params.value);\n      delete eventListenerGetValueCallbacks[tag];\n    },\n  );\n  globalEventEmitterAnimationFinishedListener =\n    RCTDeviceEventEmitter.addListener(\n      'onNativeAnimatedModuleAnimationFinished',\n      function (params) {\n        const {animationId} = params;\n        const callback = eventListenerAnimationFinishedCallbacks[animationId];\n        if (!callback) {\n          return;\n        }\n        callback(params);\n        delete eventListenerAnimationFinishedCallbacks[animationId];\n      },\n    );\n}\n\n/**\n * Styles allowed by the native animated implementation.\n *\n * In general native animated implementation should support any numeric or color property that\n * doesn't need to be updated through the shadow view hierarchy (all non-layout properties).\n */\nconst SUPPORTED_COLOR_STYLES = {\n  backgroundColor: true,\n  borderBottomColor: true,\n  borderColor: true,\n  borderEndColor: true,\n  borderLeftColor: true,\n  borderRightColor: true,\n  borderStartColor: true,\n  borderTopColor: true,\n  color: true,\n  tintColor: true,\n};\n\nconst SUPPORTED_STYLES = {\n  ...SUPPORTED_COLOR_STYLES,\n  borderBottomEndRadius: true,\n  borderBottomLeftRadius: true,\n  borderBottomRightRadius: true,\n  borderBottomStartRadius: true,\n  borderRadius: true,\n  borderTopEndRadius: true,\n  borderTopLeftRadius: true,\n  borderTopRightRadius: true,\n  borderTopStartRadius: true,\n  elevation: true,\n  opacity: true,\n  transform: true,\n  zIndex: true,\n  /* ios styles */\n  shadowOpacity: true,\n  shadowRadius: true,\n  /* legacy android transform properties */\n  scaleX: true,\n  scaleY: true,\n  translateX: true,\n  translateY: true,\n};\n\nconst SUPPORTED_TRANSFORMS = {\n  translateX: true,\n  translateY: true,\n  scale: true,\n  scaleX: true,\n  scaleY: true,\n  rotate: true,\n  rotateX: true,\n  rotateY: true,\n  rotateZ: true,\n  perspective: true,\n};\n\nconst SUPPORTED_INTERPOLATION_PARAMS = {\n  inputRange: true,\n  outputRange: true,\n  extrapolate: true,\n  extrapolateRight: true,\n  extrapolateLeft: true,\n};\n\nfunction addWhitelistedStyleProp(prop: string): void {\n  SUPPORTED_STYLES[prop] = true;\n}\n\nfunction addWhitelistedTransformProp(prop: string): void {\n  SUPPORTED_TRANSFORMS[prop] = true;\n}\n\nfunction addWhitelistedInterpolationParam(param: string): void {\n  SUPPORTED_INTERPOLATION_PARAMS[param] = true;\n}\n\nfunction isSupportedColorStyleProp(prop: string): boolean {\n  return SUPPORTED_COLOR_STYLES.hasOwnProperty(prop);\n}\n\nfunction isSupportedStyleProp(prop: string): boolean {\n  return SUPPORTED_STYLES.hasOwnProperty(prop);\n}\n\nfunction isSupportedTransformProp(prop: string): boolean {\n  return SUPPORTED_TRANSFORMS.hasOwnProperty(prop);\n}\n\nfunction isSupportedInterpolationParam(param: string): boolean {\n  return SUPPORTED_INTERPOLATION_PARAMS.hasOwnProperty(param);\n}\n\nfunction validateTransform(\n  configs: Array<\n    | {\n        type: 'animated',\n        property: string,\n        nodeTag: ?number,\n        ...\n      }\n    | {\n        type: 'static',\n        property: string,\n        value: number | string,\n        ...\n      },\n  >,\n): void {\n  configs.forEach(config => {\n    if (!isSupportedTransformProp(config.property)) {\n      throw new Error(\n        `Property '${config.property}' is not supported by native animated module`,\n      );\n    }\n  });\n}\n\nfunction validateStyles(styles: {[key: string]: ?number, ...}): void {\n  for (const key in styles) {\n    if (!isSupportedStyleProp(key)) {\n      throw new Error(\n        `Style property '${key}' is not supported by native animated module`,\n      );\n    }\n  }\n}\n\nfunction validateInterpolation<OutputT: number | string>(\n  config: InterpolationConfigType<OutputT>,\n): void {\n  for (const key in config) {\n    if (!isSupportedInterpolationParam(key)) {\n      throw new Error(\n        `Interpolation property '${key}' is not supported by native animated module`,\n      );\n    }\n  }\n}\n\nfunction generateNewNodeTag(): number {\n  return __nativeAnimatedNodeTagCount++;\n}\n\nfunction generateNewAnimationId(): number {\n  return __nativeAnimationIdCount++;\n}\n\nfunction assertNativeAnimatedModule(): void {\n  invariant(NativeAnimatedModule, 'Native animated module is not available');\n}\n\nlet _warnedMissingNativeAnimated = false;\n\nfunction shouldUseNativeDriver(\n  config: $ReadOnly<{...AnimationConfig, ...}> | EventConfig,\n): boolean {\n  if (config.useNativeDriver == null) {\n    console.warn(\n      'Animated: `useNativeDriver` was not specified. This is a required ' +\n        'option and must be explicitly set to `true` or `false`',\n    );\n  }\n\n  if (config.useNativeDriver === true && !NativeAnimatedModule) {\n    if (!_warnedMissingNativeAnimated) {\n      console.warn(\n        'Animated: `useNativeDriver` is not supported because the native ' +\n          'animated module is missing. Falling back to JS-based animation. To ' +\n          'resolve this, add `RCTAnimation` module to this app, or remove ' +\n          '`useNativeDriver`. ' +\n          'Make sure to run `bundle exec pod install` first. Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md',\n      );\n      _warnedMissingNativeAnimated = true;\n    }\n    return false;\n  }\n\n  return config.useNativeDriver || false;\n}\n\nfunction transformDataType(value: number | string): number | string {\n  // Change the string type to number type so we can reuse the same logic in\n  // iOS and Android platform\n  if (typeof value !== 'string') {\n    return value;\n  }\n  if (/deg$/.test(value)) {\n    const degrees = parseFloat(value) || 0;\n    const radians = (degrees * Math.PI) / 180.0;\n    return radians;\n  } else {\n    return value;\n  }\n}\n\nexport {\n  API,\n  isSupportedColorStyleProp,\n  isSupportedStyleProp,\n  isSupportedTransformProp,\n  isSupportedInterpolationParam,\n  addWhitelistedStyleProp,\n  addWhitelistedTransformProp,\n  addWhitelistedInterpolationParam,\n  validateStyles,\n  validateTransform,\n  validateInterpolation,\n  generateNewNodeTag,\n  generateNewAnimationId,\n  assertNativeAnimatedModule,\n  shouldUseNativeDriver,\n  transformDataType\n};\n\nexport default {\n  API,\n  isSupportedColorStyleProp,\n  isSupportedStyleProp,\n  isSupportedTransformProp,\n  isSupportedInterpolationParam,\n  addWhitelistedStyleProp,\n  addWhitelistedTransformProp,\n  addWhitelistedInterpolationParam,\n  validateStyles,\n  validateTransform,\n  validateInterpolation,\n  generateNewNodeTag,\n  generateNewAnimationId,\n  assertNativeAnimatedModule,\n  shouldUseNativeDriver,\n  transformDataType,\n  // $FlowExpectedError[unsafe-getters-setters] - unsafe getter lint suppresion\n  // $FlowExpectedError[missing-type-arg] - unsafe getter lint suppresion\n  get nativeEventEmitter(): NativeEventEmitter {\n    if (!nativeEventEmitter) {\n      nativeEventEmitter = new NativeEventEmitter(\n        // T88715063: NativeEventEmitter only used this parameter on iOS. Now it uses it on all platforms, so this code was modified automatically to preserve its behavior\n        // If you want to use the native module on other platforms, please remove this condition and test its behavior\n        Platform.OS !== 'ios' ? null : NativeAnimatedModule,\n      );\n    }\n    return nativeEventEmitter;\n  },\n};\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/NativeAnimatedModule.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\nimport type {TurboModule} from '../TurboModule/RCTExport';\nimport * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';\n\ntype EndResult = {finished: boolean, ...};\ntype EndCallback = (result: EndResult) => void;\ntype SaveValueCallback = (value: number) => void;\n\nexport type EventMapping = {|\n  nativeEventPath: Array<string>,\n  animatedValueTag: ?number,\n|};\n\n// The config has different keys depending on the type of the Node\n// TODO(T54896888): Make these types strict\nexport type AnimatedNodeConfig = Object;\nexport type AnimatingNodeConfig = Object;\n\nexport interface Spec extends TurboModule {\n  +startOperationBatch: () => void;\n  +finishOperationBatch: () => void;\n  +createAnimatedNode: (tag: number, config: AnimatedNodeConfig) => void;\n  +updateAnimatedNodeConfig?: (tag: number, config: AnimatedNodeConfig) => void;\n  +getValue: (tag: number, saveValueCallback: SaveValueCallback) => void;\n  +startListeningToAnimatedNodeValue: (tag: number) => void;\n  +stopListeningToAnimatedNodeValue: (tag: number) => void;\n  +connectAnimatedNodes: (parentTag: number, childTag: number) => void;\n  +disconnectAnimatedNodes: (parentTag: number, childTag: number) => void;\n  +startAnimatingNode: (\n    animationId: number,\n    nodeTag: number,\n    config: AnimatingNodeConfig,\n    endCallback: EndCallback,\n  ) => void;\n  +stopAnimation: (animationId: number) => void;\n  +setAnimatedNodeValue: (nodeTag: number, value: number) => void;\n  +setAnimatedNodeOffset: (nodeTag: number, offset: number) => void;\n  +flattenAnimatedNodeOffset: (nodeTag: number) => void;\n  +extractAnimatedNodeOffset: (nodeTag: number) => void;\n  +connectAnimatedNodeToView: (nodeTag: number, viewTag: number) => void;\n  +disconnectAnimatedNodeFromView: (nodeTag: number, viewTag: number) => void;\n  +restoreDefaultValues: (nodeTag: number) => void;\n  +dropAnimatedNode: (tag: number) => void;\n  +addAnimatedEventToView: (\n    viewTag: number,\n    eventName: string,\n    eventMapping: EventMapping,\n  ) => void;\n  +removeAnimatedEventFromView: (\n    viewTag: number,\n    eventName: string,\n    animatedNodeTag: number,\n  ) => void;\n\n  // Events\n  +addListener: (eventName: string) => void;\n  +removeListeners: (count: number) => void;\n\n  // All of the above in a batched mode\n  +queueAndExecuteBatchedOperations?: (operationsAndArgs: Array<any>) => void;\n}\n\nexport default (TurboModuleRegistry.get<Spec>('NativeAnimatedModule'): ?Spec);\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/NativeAnimatedTurboModule.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\nimport type {TurboModule} from '../TurboModule/RCTExport';\nimport * as TurboModuleRegistry from '../TurboModule/TurboModuleRegistry';\n\ntype EndResult = {finished: boolean, ...};\ntype EndCallback = (result: EndResult) => void;\ntype SaveValueCallback = (value: number) => void;\n\nexport type EventMapping = {|\n  nativeEventPath: Array<string>,\n  animatedValueTag: ?number,\n|};\n\n// The config has different keys depending on the type of the Node\n// TODO(T54896888): Make these types strict\nexport type AnimatedNodeConfig = Object;\nexport type AnimatingNodeConfig = Object;\n\nexport interface Spec extends TurboModule {\n  +startOperationBatch: () => void;\n  +finishOperationBatch: () => void;\n  +createAnimatedNode: (tag: number, config: AnimatedNodeConfig) => void;\n  +getValue: (tag: number, saveValueCallback: SaveValueCallback) => void;\n  +startListeningToAnimatedNodeValue: (tag: number) => void;\n  +stopListeningToAnimatedNodeValue: (tag: number) => void;\n  +connectAnimatedNodes: (parentTag: number, childTag: number) => void;\n  +disconnectAnimatedNodes: (parentTag: number, childTag: number) => void;\n  +startAnimatingNode: (\n    animationId: number,\n    nodeTag: number,\n    config: AnimatingNodeConfig,\n    endCallback: EndCallback,\n  ) => void;\n  +stopAnimation: (animationId: number) => void;\n  +setAnimatedNodeValue: (nodeTag: number, value: number) => void;\n  +setAnimatedNodeOffset: (nodeTag: number, offset: number) => void;\n  +flattenAnimatedNodeOffset: (nodeTag: number) => void;\n  +extractAnimatedNodeOffset: (nodeTag: number) => void;\n  +connectAnimatedNodeToView: (nodeTag: number, viewTag: number) => void;\n  +disconnectAnimatedNodeFromView: (nodeTag: number, viewTag: number) => void;\n  +restoreDefaultValues: (nodeTag: number) => void;\n  +dropAnimatedNode: (tag: number) => void;\n  +addAnimatedEventToView: (\n    viewTag: number,\n    eventName: string,\n    eventMapping: EventMapping,\n  ) => void;\n  +removeAnimatedEventFromView: (\n    viewTag: number,\n    eventName: string,\n    animatedNodeTag: number,\n  ) => void;\n\n  // Events\n  +addListener: (eventName: string) => void;\n  +removeListeners: (count: number) => void;\n}\n\nexport default (TurboModuleRegistry.get<Spec>(\n  'NativeAnimatedTurboModule',\n): ?Spec);\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/SpringConfig.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * @flow strict\n */\n\n'use strict';\n\ntype SpringConfigType = {\n  stiffness: number,\n  damping: number,\n  ...\n};\n\nfunction stiffnessFromOrigamiValue(oValue) {\n  return (oValue - 30) * 3.62 + 194;\n}\n\nfunction dampingFromOrigamiValue(oValue) {\n  return (oValue - 8) * 3 + 25;\n}\n\nfunction fromOrigamiTensionAndFriction(\n  tension: number,\n  friction: number,\n): SpringConfigType {\n  return {\n    stiffness: stiffnessFromOrigamiValue(tension),\n    damping: dampingFromOrigamiValue(friction),\n  };\n}\n\nfunction fromBouncinessAndSpeed(\n  bounciness: number,\n  speed: number,\n): SpringConfigType {\n  function normalize(value, startValue, endValue) {\n    return (value - startValue) / (endValue - startValue);\n  }\n\n  function projectNormal(n, start, end) {\n    return start + n * (end - start);\n  }\n\n  function linearInterpolation(t, start, end) {\n    return t * end + (1 - t) * start;\n  }\n\n  function quadraticOutInterpolation(t, start, end) {\n    return linearInterpolation(2 * t - t * t, start, end);\n  }\n\n  function b3Friction1(x) {\n    return 0.0007 * Math.pow(x, 3) - 0.031 * Math.pow(x, 2) + 0.64 * x + 1.28;\n  }\n\n  function b3Friction2(x) {\n    return 0.000044 * Math.pow(x, 3) - 0.006 * Math.pow(x, 2) + 0.36 * x + 2;\n  }\n\n  function b3Friction3(x) {\n    return (\n      0.00000045 * Math.pow(x, 3) -\n      0.000332 * Math.pow(x, 2) +\n      0.1078 * x +\n      5.84\n    );\n  }\n\n  function b3Nobounce(tension) {\n    if (tension <= 18) {\n      return b3Friction1(tension);\n    } else if (tension > 18 && tension <= 44) {\n      return b3Friction2(tension);\n    } else {\n      return b3Friction3(tension);\n    }\n  }\n\n  let b = normalize(bounciness / 1.7, 0, 20);\n  b = projectNormal(b, 0, 0.8);\n  const s = normalize(speed / 1.7, 0, 20);\n  const bouncyTension = projectNormal(s, 0.5, 200);\n  const bouncyFriction = quadraticOutInterpolation(\n    b,\n    b3Nobounce(bouncyTension),\n    0.01,\n  );\n\n  return {\n    stiffness: stiffnessFromOrigamiValue(bouncyTension),\n    damping: dampingFromOrigamiValue(bouncyFriction),\n  };\n}\n\nexport default {\n  fromOrigamiTensionAndFriction,\n  fromBouncinessAndSpeed,\n};\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/animations/Animation.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\nimport type {PlatformConfig} from '../AnimatedPlatformConfig';\nimport type AnimatedValue from '../nodes/AnimatedValue';\n\nexport type EndResult = {finished: boolean, ...};\nexport type EndCallback = (result: EndResult) => void;\n\nexport type AnimationConfig = {\n  isInteraction?: boolean,\n  useNativeDriver: boolean,\n  platformConfig?: PlatformConfig,\n  onComplete?: ?EndCallback,\n  iterations?: number,\n};\n\nlet startNativeAnimationNextId = 1;\n\n// Important note: start() and stop() will only be called at most once.\n// Once an animation has been stopped or finished its course, it will\n// not be reused.\nclass Animation {\n  __active: boolean;\n  __isInteraction: boolean;\n  __nativeId: number;\n  __onEnd: ?EndCallback;\n  __iterations: number;\n  start(\n    fromValue: number,\n    onUpdate: (value: number) => void,\n    onEnd: ?EndCallback,\n    previousAnimation: ?Animation,\n    animatedValue: AnimatedValue,\n  ): void {}\n  stop(): void {\n    if (this.__nativeId) {\n      NativeAnimatedHelper.API.stopAnimation(this.__nativeId);\n    }\n  }\n  __getNativeAnimationConfig(): any {\n    // Subclasses that have corresponding animation implementation done in native\n    // should override this method\n    throw new Error('This animation type cannot be offloaded to native');\n  }\n  // Helper function for subclasses to make sure onEnd is only called once.\n  __debouncedOnEnd(result: EndResult): void {\n    const onEnd = this.__onEnd;\n    this.__onEnd = null;\n    onEnd && onEnd(result);\n  }\n  __startNativeAnimation(animatedValue: AnimatedValue): void {\n    const startNativeAnimationWaitId = `${startNativeAnimationNextId}:startAnimation`;\n    startNativeAnimationNextId += 1;\n    NativeAnimatedHelper.API.setWaitingForIdentifier(\n      startNativeAnimationWaitId,\n    );\n    try {\n      const config = this.__getNativeAnimationConfig();\n      animatedValue.__makeNative(config.platformConfig);\n      this.__nativeId = NativeAnimatedHelper.generateNewAnimationId();\n      NativeAnimatedHelper.API.startAnimatingNode(\n        this.__nativeId,\n        animatedValue.__getNativeTag(),\n        config,\n        // $FlowFixMe[method-unbinding] added when improving typing for this parameters\n        this.__debouncedOnEnd.bind(this),\n      );\n    } catch (e) {\n      throw e;\n    } finally {\n      NativeAnimatedHelper.API.unsetWaitingForIdentifier(\n        startNativeAnimationWaitId,\n      );\n    }\n  }\n}\n\nexport default Animation;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/animations/DecayAnimation.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport Animation from './Animation';\n\nimport {shouldUseNativeDriver} from '../NativeAnimatedHelper';\n\nimport type AnimatedValue from '../nodes/AnimatedValue';\nimport type {AnimationConfig, EndCallback} from './Animation';\n\nexport type DecayAnimationConfig = {\n  ...AnimationConfig,\n  velocity:\n    | number\n    | {\n        x: number,\n        y: number,\n        ...\n      },\n  deceleration?: number,\n};\n\nexport type DecayAnimationConfigSingle = {\n  ...AnimationConfig,\n  velocity: number,\n  deceleration?: number,\n};\n\nclass DecayAnimation extends Animation {\n  _startTime: number;\n  _lastValue: number;\n  _fromValue: number;\n  _deceleration: number;\n  _velocity: number;\n  _onUpdate: (value: number) => void;\n  _animationFrame: any;\n  _useNativeDriver: boolean;\n\n  constructor(config: DecayAnimationConfigSingle) {\n    super();\n    this._deceleration = config.deceleration ?? 0.998;\n    this._velocity = config.velocity;\n    this._useNativeDriver = shouldUseNativeDriver(config);\n    this.__isInteraction = config.isInteraction ?? !this._useNativeDriver;\n    this.__iterations = config.iterations ?? 1;\n  }\n\n  __getNativeAnimationConfig(): {|\n    deceleration: number,\n    iterations: number,\n    type: $TEMPORARY$string<'decay'>,\n    velocity: number,\n  |} {\n    return {\n      type: 'decay',\n      deceleration: this._deceleration,\n      velocity: this._velocity,\n      iterations: this.__iterations,\n    };\n  }\n\n  start(\n    fromValue: number,\n    onUpdate: (value: number) => void,\n    onEnd: ?EndCallback,\n    previousAnimation: ?Animation,\n    animatedValue: AnimatedValue,\n  ): void {\n    this.__active = true;\n    this._lastValue = fromValue;\n    this._fromValue = fromValue;\n    this._onUpdate = onUpdate;\n    this.__onEnd = onEnd;\n    this._startTime = Date.now();\n    if (this._useNativeDriver) {\n      this.__startNativeAnimation(animatedValue);\n    } else {\n      this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));\n    }\n  }\n\n  onUpdate(): void {\n    const now = Date.now();\n\n    const value =\n      this._fromValue +\n      (this._velocity / (1 - this._deceleration)) *\n        (1 - Math.exp(-(1 - this._deceleration) * (now - this._startTime)));\n\n    this._onUpdate(value);\n\n    if (Math.abs(this._lastValue - value) < 0.1) {\n      this.__debouncedOnEnd({finished: true});\n      return;\n    }\n\n    this._lastValue = value;\n    if (this.__active) {\n      this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));\n    }\n  }\n\n  stop(): void {\n    super.stop();\n    this.__active = false;\n    global.cancelAnimationFrame(this._animationFrame);\n    this.__debouncedOnEnd({finished: false});\n  }\n}\n\nexport default DecayAnimation;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/animations/SpringAnimation.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport type AnimatedValue from '../nodes/AnimatedValue';\nimport type AnimatedValueXY from '../nodes/AnimatedValueXY';\nimport type AnimatedInterpolation from '../nodes/AnimatedInterpolation';\n\nimport Animation from './Animation';\nimport SpringConfig from '../SpringConfig';\n\nimport invariant from 'fbjs/lib/invariant';\n\nimport {shouldUseNativeDriver} from '../NativeAnimatedHelper';\n\nimport type {PlatformConfig} from '../AnimatedPlatformConfig';\nimport type {AnimationConfig, EndCallback} from './Animation';\n\nimport AnimatedColor from '../nodes/AnimatedColor';\n\nexport type SpringAnimationConfig = {\n  ...AnimationConfig,\n  toValue:\n    | number\n    | AnimatedValue\n    | {\n        x: number,\n        y: number,\n        ...\n      }\n    | AnimatedValueXY\n    | {\n        r: number,\n        g: number,\n        b: number,\n        a: number,\n        ...\n      }\n    | AnimatedColor\n    | AnimatedInterpolation<number>,\n  overshootClamping?: boolean,\n  restDisplacementThreshold?: number,\n  restSpeedThreshold?: number,\n  velocity?:\n    | number\n    | {\n        x: number,\n        y: number,\n        ...\n      },\n  bounciness?: number,\n  speed?: number,\n  tension?: number,\n  friction?: number,\n  stiffness?: number,\n  damping?: number,\n  mass?: number,\n  delay?: number,\n};\n\nexport type SpringAnimationConfigSingle = {\n  ...AnimationConfig,\n  toValue: number,\n  overshootClamping?: boolean,\n  restDisplacementThreshold?: number,\n  restSpeedThreshold?: number,\n  velocity?: number,\n  bounciness?: number,\n  speed?: number,\n  tension?: number,\n  friction?: number,\n  stiffness?: number,\n  damping?: number,\n  mass?: number,\n  delay?: number,\n};\n\nclass SpringAnimation extends Animation {\n  _overshootClamping: boolean;\n  _restDisplacementThreshold: number;\n  _restSpeedThreshold: number;\n  _lastVelocity: number;\n  _startPosition: number;\n  _lastPosition: number;\n  _fromValue: number;\n  _toValue: number;\n  _stiffness: number;\n  _damping: number;\n  _mass: number;\n  _initialVelocity: number;\n  _delay: number;\n  _timeout: any;\n  _startTime: number;\n  _lastTime: number;\n  _frameTime: number;\n  _onUpdate: (value: number) => void;\n  _animationFrame: any;\n  _useNativeDriver: boolean;\n  _platformConfig: ?PlatformConfig;\n\n  constructor(config: SpringAnimationConfigSingle) {\n    super();\n\n    this._overshootClamping = config.overshootClamping ?? false;\n    this._restDisplacementThreshold = config.restDisplacementThreshold ?? 0.001;\n    this._restSpeedThreshold = config.restSpeedThreshold ?? 0.001;\n    this._initialVelocity = config.velocity ?? 0;\n    this._lastVelocity = config.velocity ?? 0;\n    this._toValue = config.toValue;\n    this._delay = config.delay ?? 0;\n    this._useNativeDriver = shouldUseNativeDriver(config);\n    this._platformConfig = config.platformConfig;\n    this.__isInteraction = config.isInteraction ?? !this._useNativeDriver;\n    this.__iterations = config.iterations ?? 1;\n\n    if (\n      config.stiffness !== undefined ||\n      config.damping !== undefined ||\n      config.mass !== undefined\n    ) {\n      invariant(\n        config.bounciness === undefined &&\n          config.speed === undefined &&\n          config.tension === undefined &&\n          config.friction === undefined,\n        'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one',\n      );\n      this._stiffness = config.stiffness ?? 100;\n      this._damping = config.damping ?? 10;\n      this._mass = config.mass ?? 1;\n    } else if (config.bounciness !== undefined || config.speed !== undefined) {\n      // Convert the origami bounciness/speed values to stiffness/damping\n      // We assume mass is 1.\n      invariant(\n        config.tension === undefined &&\n          config.friction === undefined &&\n          config.stiffness === undefined &&\n          config.damping === undefined &&\n          config.mass === undefined,\n        'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one',\n      );\n      const springConfig = SpringConfig.fromBouncinessAndSpeed(\n        config.bounciness ?? 8,\n        config.speed ?? 12,\n      );\n      this._stiffness = springConfig.stiffness;\n      this._damping = springConfig.damping;\n      this._mass = 1;\n    } else {\n      // Convert the origami tension/friction values to stiffness/damping\n      // We assume mass is 1.\n      const springConfig = SpringConfig.fromOrigamiTensionAndFriction(\n        config.tension ?? 40,\n        config.friction ?? 7,\n      );\n      this._stiffness = springConfig.stiffness;\n      this._damping = springConfig.damping;\n      this._mass = 1;\n    }\n\n    invariant(this._stiffness > 0, 'Stiffness value must be greater than 0');\n    invariant(this._damping > 0, 'Damping value must be greater than 0');\n    invariant(this._mass > 0, 'Mass value must be greater than 0');\n  }\n\n  __getNativeAnimationConfig(): {|\n    damping: number,\n    initialVelocity: number,\n    iterations: number,\n    mass: number,\n    platformConfig: ?PlatformConfig,\n    overshootClamping: boolean,\n    restDisplacementThreshold: number,\n    restSpeedThreshold: number,\n    stiffness: number,\n    toValue: any,\n    type: $TEMPORARY$string<'spring'>,\n  |} {\n    return {\n      type: 'spring',\n      overshootClamping: this._overshootClamping,\n      restDisplacementThreshold: this._restDisplacementThreshold,\n      restSpeedThreshold: this._restSpeedThreshold,\n      stiffness: this._stiffness,\n      damping: this._damping,\n      mass: this._mass,\n      initialVelocity: this._initialVelocity ?? this._lastVelocity,\n      toValue: this._toValue,\n      iterations: this.__iterations,\n      platformConfig: this._platformConfig,\n    };\n  }\n\n  start(\n    fromValue: number,\n    onUpdate: (value: number) => void,\n    onEnd: ?EndCallback,\n    previousAnimation: ?Animation,\n    animatedValue: AnimatedValue,\n  ): void {\n    this.__active = true;\n    this._startPosition = fromValue;\n    this._lastPosition = this._startPosition;\n\n    this._onUpdate = onUpdate;\n    this.__onEnd = onEnd;\n    this._lastTime = Date.now();\n    this._frameTime = 0.0;\n\n    if (previousAnimation instanceof SpringAnimation) {\n      const internalState = previousAnimation.getInternalState();\n      this._lastPosition = internalState.lastPosition;\n      this._lastVelocity = internalState.lastVelocity;\n      // Set the initial velocity to the last velocity\n      this._initialVelocity = this._lastVelocity;\n      this._lastTime = internalState.lastTime;\n    }\n\n    const start = () => {\n      if (this._useNativeDriver) {\n        this.__startNativeAnimation(animatedValue);\n      } else {\n        this.onUpdate();\n      }\n    };\n\n    //  If this._delay is more than 0, we start after the timeout.\n    if (this._delay) {\n      this._timeout = setTimeout(start, this._delay);\n    } else {\n      start();\n    }\n  }\n\n  getInternalState(): Object {\n    return {\n      lastPosition: this._lastPosition,\n      lastVelocity: this._lastVelocity,\n      lastTime: this._lastTime,\n    };\n  }\n\n  /**\n   * This spring model is based off of a damped harmonic oscillator\n   * (https://en.wikipedia.org/wiki/Harmonic_oscillator#Damped_harmonic_oscillator).\n   *\n   * We use the closed form of the second order differential equation:\n   *\n   * x'' + (2ζ⍵_0)x' + ⍵^2x = 0\n   *\n   * where\n   *    ⍵_0 = √(k / m) (undamped angular frequency of the oscillator),\n   *    ζ = c / 2√mk (damping ratio),\n   *    c = damping constant\n   *    k = stiffness\n   *    m = mass\n   *\n   * The derivation of the closed form is described in detail here:\n   * http://planetmath.org/sites/default/files/texpdf/39745.pdf\n   *\n   * This algorithm happens to match the algorithm used by CASpringAnimation,\n   * a QuartzCore (iOS) API that creates spring animations.\n   */\n  onUpdate(): void {\n    // If for some reason we lost a lot of frames (e.g. process large payload or\n    // stopped in the debugger), we only advance by 4 frames worth of\n    // computation and will continue on the next frame. It's better to have it\n    // running at faster speed than jumping to the end.\n    const MAX_STEPS = 64;\n    let now = Date.now();\n    if (now > this._lastTime + MAX_STEPS) {\n      now = this._lastTime + MAX_STEPS;\n    }\n\n    const deltaTime = (now - this._lastTime) / 1000;\n    this._frameTime += deltaTime;\n\n    const c: number = this._damping;\n    const m: number = this._mass;\n    const k: number = this._stiffness;\n    const v0: number = -this._initialVelocity;\n\n    const zeta = c / (2 * Math.sqrt(k * m)); // damping ratio\n    const omega0 = Math.sqrt(k / m); // undamped angular frequency of the oscillator (rad/ms)\n    const omega1 = omega0 * Math.sqrt(1.0 - zeta * zeta); // exponential decay\n    const x0 = this._toValue - this._startPosition; // calculate the oscillation from x0 = 1 to x = 0\n\n    let position = 0.0;\n    let velocity = 0.0;\n    const t = this._frameTime;\n    if (zeta < 1) {\n      // Under damped\n      const envelope = Math.exp(-zeta * omega0 * t);\n      position =\n        this._toValue -\n        envelope *\n          (((v0 + zeta * omega0 * x0) / omega1) * Math.sin(omega1 * t) +\n            x0 * Math.cos(omega1 * t));\n      // This looks crazy -- it's actually just the derivative of the\n      // oscillation function\n      velocity =\n        zeta *\n          omega0 *\n          envelope *\n          ((Math.sin(omega1 * t) * (v0 + zeta * omega0 * x0)) / omega1 +\n            x0 * Math.cos(omega1 * t)) -\n        envelope *\n          (Math.cos(omega1 * t) * (v0 + zeta * omega0 * x0) -\n            omega1 * x0 * Math.sin(omega1 * t));\n    } else {\n      // Critically damped\n      const envelope = Math.exp(-omega0 * t);\n      position = this._toValue - envelope * (x0 + (v0 + omega0 * x0) * t);\n      velocity =\n        envelope * (v0 * (t * omega0 - 1) + t * x0 * (omega0 * omega0));\n    }\n\n    this._lastTime = now;\n    this._lastPosition = position;\n    this._lastVelocity = velocity;\n\n    this._onUpdate(position);\n    if (!this.__active) {\n      // a listener might have stopped us in _onUpdate\n      return;\n    }\n\n    // Conditions for stopping the spring animation\n    let isOvershooting = false;\n    if (this._overshootClamping && this._stiffness !== 0) {\n      if (this._startPosition < this._toValue) {\n        isOvershooting = position > this._toValue;\n      } else {\n        isOvershooting = position < this._toValue;\n      }\n    }\n    const isVelocity = Math.abs(velocity) <= this._restSpeedThreshold;\n    let isDisplacement = true;\n    if (this._stiffness !== 0) {\n      isDisplacement =\n        Math.abs(this._toValue - position) <= this._restDisplacementThreshold;\n    }\n\n    if (isOvershooting || (isVelocity && isDisplacement)) {\n      if (this._stiffness !== 0) {\n        // Ensure that we end up with a round value\n        this._lastPosition = this._toValue;\n        this._lastVelocity = 0;\n        this._onUpdate(this._toValue);\n      }\n\n      this.__debouncedOnEnd({finished: true});\n      return;\n    }\n    // $FlowFixMe[method-unbinding] added when improving typing for this parameters\n    this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));\n  }\n\n  stop(): void {\n    super.stop();\n    this.__active = false;\n    clearTimeout(this._timeout);\n    global.cancelAnimationFrame(this._animationFrame);\n    this.__debouncedOnEnd({finished: false});\n  }\n}\n\nexport default SpringAnimation;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/animations/TimingAnimation.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport AnimatedValue from '../nodes/AnimatedValue';\nimport AnimatedValueXY from '../nodes/AnimatedValueXY';\nimport AnimatedInterpolation from '../nodes/AnimatedInterpolation';\nimport Easing from '../../../../exports/Easing';\n\nimport Animation from './Animation';\n\nimport {shouldUseNativeDriver} from '../NativeAnimatedHelper';\n\nimport type {PlatformConfig} from '../AnimatedPlatformConfig';\nimport type {AnimationConfig, EndCallback} from './Animation';\nimport type {RgbaValue} from '../nodes/AnimatedColor';\n\nimport AnimatedColor from '../nodes/AnimatedColor';\n\nexport type TimingAnimationConfig = $ReadOnly<{\n  ...AnimationConfig,\n  toValue:\n    | number\n    | AnimatedValue\n    | {\n        x: number,\n        y: number,\n        ...\n      }\n    | AnimatedValueXY\n    | RgbaValue\n    | AnimatedColor\n    | AnimatedInterpolation<number>,\n  easing?: (value: number) => number,\n  duration?: number,\n  delay?: number,\n}>;\n\nexport type TimingAnimationConfigSingle = $ReadOnly<{\n  ...AnimationConfig,\n  toValue: number,\n  easing?: (value: number) => number,\n  duration?: number,\n  delay?: number,\n}>;\n\nlet _easeInOut;\nfunction easeInOut() {\n  if (!_easeInOut) {\n    _easeInOut = Easing.inOut(Easing.ease);\n  }\n  return _easeInOut;\n}\n\nclass TimingAnimation extends Animation {\n  _startTime: number;\n  _fromValue: number;\n  _toValue: number;\n  _duration: number;\n  _delay: number;\n  _easing: (value: number) => number;\n  _onUpdate: (value: number) => void;\n  _animationFrame: any;\n  _timeout: any;\n  _useNativeDriver: boolean;\n  _platformConfig: ?PlatformConfig;\n\n  constructor(config: TimingAnimationConfigSingle) {\n    super();\n    this._toValue = config.toValue;\n    this._easing = config.easing ?? easeInOut();\n    this._duration = config.duration ?? 500;\n    this._delay = config.delay ?? 0;\n    this.__iterations = config.iterations ?? 1;\n    this._useNativeDriver = shouldUseNativeDriver(config);\n    this._platformConfig = config.platformConfig;\n    this.__isInteraction = config.isInteraction ?? !this._useNativeDriver;\n  }\n\n  __getNativeAnimationConfig(): any {\n    const frameDuration = 1000.0 / 60.0;\n    const frames = [];\n    const numFrames = Math.round(this._duration / frameDuration);\n    for (let frame = 0; frame < numFrames; frame++) {\n      frames.push(this._easing(frame / numFrames));\n    }\n    frames.push(this._easing(1));\n    return {\n      type: 'frames',\n      frames,\n      toValue: this._toValue,\n      iterations: this.__iterations,\n      platformConfig: this._platformConfig,\n    };\n  }\n\n  start(\n    fromValue: number,\n    onUpdate: (value: number) => void,\n    onEnd: ?EndCallback,\n    previousAnimation: ?Animation,\n    animatedValue: AnimatedValue,\n  ): void {\n    this.__active = true;\n    this._fromValue = fromValue;\n    this._onUpdate = onUpdate;\n    this.__onEnd = onEnd;\n\n    const start = () => {\n      // Animations that sometimes have 0 duration and sometimes do not\n      // still need to use the native driver when duration is 0 so as to\n      // not cause intermixed JS and native animations.\n      if (this._duration === 0 && !this._useNativeDriver) {\n        this._onUpdate(this._toValue);\n        this.__debouncedOnEnd({finished: true});\n      } else {\n        this._startTime = Date.now();\n        if (this._useNativeDriver) {\n          this.__startNativeAnimation(animatedValue);\n        } else {\n          this._animationFrame = requestAnimationFrame(\n            // $FlowFixMe[method-unbinding] added when improving typing for this parameters\n            this.onUpdate.bind(this),\n          );\n        }\n      }\n    };\n    if (this._delay) {\n      this._timeout = setTimeout(start, this._delay);\n    } else {\n      start();\n    }\n  }\n\n  onUpdate(): void {\n    const now = Date.now();\n    if (now >= this._startTime + this._duration) {\n      if (this._duration === 0) {\n        this._onUpdate(this._toValue);\n      } else {\n        this._onUpdate(\n          this._fromValue + this._easing(1) * (this._toValue - this._fromValue),\n        );\n      }\n      this.__debouncedOnEnd({finished: true});\n      return;\n    }\n\n    this._onUpdate(\n      this._fromValue +\n        this._easing((now - this._startTime) / this._duration) *\n          (this._toValue - this._fromValue),\n    );\n    if (this.__active) {\n      // $FlowFixMe[method-unbinding] added when improving typing for this parameters\n      this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));\n    }\n  }\n\n  stop(): void {\n    super.stop();\n    this.__active = false;\n    clearTimeout(this._timeout);\n    global.cancelAnimationFrame(this._animationFrame);\n    this.__debouncedOnEnd({finished: false});\n  }\n}\n\nexport default TimingAnimation;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/bezier.js",
    "content": "/**\n * Portions Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict\n * @format\n */\n\n/**\n * BezierEasing - use bezier curve for transition easing function\n * https://github.com/gre/bezier-easing\n * @copyright 2014-2015 Gaëtan Renaudeau. MIT License.\n */\n\n'use strict';\n\n// These values are established by empiricism with tests (tradeoff: performance VS precision)\nconst NEWTON_ITERATIONS = 4;\nconst NEWTON_MIN_SLOPE = 0.001;\nconst SUBDIVISION_PRECISION = 0.0000001;\nconst SUBDIVISION_MAX_ITERATIONS = 10;\n\nconst kSplineTableSize = 11;\nconst kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\nconst float32ArraySupported = typeof Float32Array === 'function';\n\nfunction A(aA1, aA2) {\n  return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n}\nfunction B(aA1, aA2) {\n  return 3.0 * aA2 - 6.0 * aA1;\n}\nfunction C(aA1) {\n  return 3.0 * aA1;\n}\n\n// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.\nfunction calcBezier(aT, aA1, aA2) {\n  return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n}\n\n// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.\nfunction getSlope(aT, aA1, aA2) {\n  return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n}\n\nfunction binarySubdivide(aX, _aA, _aB, mX1, mX2) {\n  let currentX,\n    currentT,\n    i = 0,\n    aA = _aA,\n    aB = _aB;\n  do {\n    currentT = aA + (aB - aA) / 2.0;\n    currentX = calcBezier(currentT, mX1, mX2) - aX;\n    if (currentX > 0.0) {\n      aB = currentT;\n    } else {\n      aA = currentT;\n    }\n  } while (\n    Math.abs(currentX) > SUBDIVISION_PRECISION &&\n    ++i < SUBDIVISION_MAX_ITERATIONS\n  );\n  return currentT;\n}\n\nfunction newtonRaphsonIterate(aX, _aGuessT, mX1, mX2) {\n  let aGuessT = _aGuessT;\n  for (let i = 0; i < NEWTON_ITERATIONS; ++i) {\n    const currentSlope = getSlope(aGuessT, mX1, mX2);\n    if (currentSlope === 0.0) {\n      return aGuessT;\n    }\n    const currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n    aGuessT -= currentX / currentSlope;\n  }\n  return aGuessT;\n}\n\nexport default function bezier(\n  mX1: number,\n  mY1: number,\n  mX2: number,\n  mY2: number,\n): (x: number) => number {\n  if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) {\n    throw new Error('bezier x values must be in [0, 1] range');\n  }\n\n  // Precompute samples table\n  const sampleValues = float32ArraySupported\n    ? new Float32Array(kSplineTableSize)\n    : new Array(kSplineTableSize);\n  if (mX1 !== mY1 || mX2 !== mY2) {\n    for (let i = 0; i < kSplineTableSize; ++i) {\n      sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n    }\n  }\n\n  function getTForX(aX) {\n    let intervalStart = 0.0;\n    let currentSample = 1;\n    const lastSample = kSplineTableSize - 1;\n\n    for (\n      ;\n      currentSample !== lastSample && sampleValues[currentSample] <= aX;\n      ++currentSample\n    ) {\n      intervalStart += kSampleStepSize;\n    }\n    --currentSample;\n\n    // Interpolate to provide an initial guess for t\n    const dist =\n      (aX - sampleValues[currentSample]) /\n      (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n    const guessForT = intervalStart + dist * kSampleStepSize;\n\n    const initialSlope = getSlope(guessForT, mX1, mX2);\n    if (initialSlope >= NEWTON_MIN_SLOPE) {\n      return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n    } else if (initialSlope === 0.0) {\n      return guessForT;\n    } else {\n      return binarySubdivide(\n        aX,\n        intervalStart,\n        intervalStart + kSampleStepSize,\n        mX1,\n        mX2,\n      );\n    }\n  }\n\n  return function BezierEasing(x: number): number {\n    if (mX1 === mY1 && mX2 === mY2) {\n      return x; // linear\n    }\n    // Because JavaScript number are imprecise, we should guarantee the extremes are right.\n    if (x === 0) {\n      return 0;\n    }\n    if (x === 1) {\n      return 1;\n    }\n    return calcBezier(getTForX(x), mY1, mY2);\n  };\n};\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/components/AnimatedFlatList.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\nimport * as React from 'react';\n\nimport FlatList from '../../../../exports/FlatList';\nimport createAnimatedComponent from '../createAnimatedComponent';\n\nimport type {AnimatedComponentType} from '../createAnimatedComponent';\n\n/**\n * @see https://github.com/facebook/react-native/commit/b8c8562\n */\nconst FlatListWithEventThrottle = React.forwardRef((props, ref) => (\n  <FlatList scrollEventThrottle={0.0001} {...props} ref={ref} />\n));\n\nexport default (createAnimatedComponent(\n  FlatListWithEventThrottle,\n): AnimatedComponentType<\n  React.ElementConfig<typeof FlatList>,\n  React.ElementRef<typeof FlatList>,\n>);\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/components/AnimatedImage.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\nimport * as React from 'react';\n\nimport Image from '../../../../exports/Image';\nimport createAnimatedComponent from '../createAnimatedComponent';\n\nimport type {AnimatedComponentType} from '../createAnimatedComponent';\n\nexport default (createAnimatedComponent(\n  (Image: $FlowFixMe),\n): AnimatedComponentType<\n  React.ElementConfig<typeof Image>,\n  React.ElementRef<typeof Image>,\n>);\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/components/AnimatedScrollView.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\nimport * as React from 'react';\n\nimport ScrollView from '../../../../exports/ScrollView';\nimport createAnimatedComponent from '../createAnimatedComponent';\n\nimport type {AnimatedComponentType} from '../createAnimatedComponent';\n\n/**\n * @see https://github.com/facebook/react-native/commit/b8c8562\n */\nconst ScrollViewWithEventThrottle = React.forwardRef((props, ref) => (\n  <ScrollView scrollEventThrottle={0.0001} {...props} ref={ref} />\n));\n\nexport default (createAnimatedComponent(\n  ScrollViewWithEventThrottle,\n): AnimatedComponentType<\n  React.ElementConfig<typeof ScrollView>,\n  React.ElementRef<typeof ScrollView>,\n>);\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/components/AnimatedSectionList.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\nimport * as React from 'react';\n\nimport SectionList from '../../../../exports/SectionList';\nimport createAnimatedComponent from '../createAnimatedComponent';\n\nimport type {AnimatedComponentType} from '../createAnimatedComponent';\n\n/**\n * @see https://github.com/facebook/react-native/commit/b8c8562\n */\nconst SectionListWithEventThrottle = React.forwardRef((props, ref) => (\n  <SectionList scrollEventThrottle={0.0001} {...props} ref={ref} />\n));\n\nexport default (createAnimatedComponent(\n  SectionListWithEventThrottle,\n): AnimatedComponentType<\n  React.ElementConfig<typeof SectionList>,\n  React.ElementRef<typeof SectionList>,\n>);\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/components/AnimatedText.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\nimport * as React from 'react';\n\nimport Text from '../../../../exports/Text';\nimport createAnimatedComponent from '../createAnimatedComponent';\n\nimport type {AnimatedComponentType} from '../createAnimatedComponent';\n\nexport default (createAnimatedComponent(\n  (Text: $FlowFixMe),\n): AnimatedComponentType<\n  React.ElementConfig<typeof Text>,\n  React.ElementRef<typeof Text>,\n>);\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/components/AnimatedView.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\nimport * as React from 'react';\n\nimport View from '../../../../exports/View';\nimport createAnimatedComponent from '../createAnimatedComponent';\n\nimport type {AnimatedComponentType} from '../createAnimatedComponent';\n\nexport default (createAnimatedComponent(View): AnimatedComponentType<\n  React.ElementConfig<typeof View>,\n  React.ElementRef<typeof View>,\n>);\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/createAnimatedComponent.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\nimport useAnimatedProps from './useAnimatedProps';\nimport useMergeRefs from '../Utilities/useMergeRefs';\nimport StyleSheet from '../../../exports/StyleSheet';\nimport View from '../../../exports/View';\nimport * as React from 'react';\n\nexport type AnimatedComponentType<\n  -Props: {+[string]: mixed, ...},\n  +Instance = mixed,\n> = React.AbstractComponent<\n  $ObjMap<\n    Props &\n      $ReadOnly<{\n        passthroughAnimatedPropExplicitValues?: React.ElementConfig<\n          typeof View,\n        >,\n      }>,\n    () => any,\n  >,\n  Instance,\n>;\n\n/**\n * Experimental implementation of `createAnimatedComponent` that is intended to\n * be compatible with concurrent rendering.\n */\nexport default function createAnimatedComponent<TProps: {...}, TInstance>(\n  Component: React.AbstractComponent<TProps, TInstance>,\n): React.AbstractComponent<TProps, TInstance> {\n  return React.forwardRef((props, forwardedRef) => {\n    const [reducedProps, callbackRef] = useAnimatedProps<TProps, TInstance>(\n      props,\n    );\n    const ref = useMergeRefs<TInstance | null>(callbackRef, forwardedRef);\n\n    // Some components require explicit passthrough values for animation\n    // to work properly. For example, if an animated component is\n    // transformed and Pressable, onPress will not work after transform\n    // without these passthrough values.\n    // $FlowFixMe[prop-missing]\n    const {passthroughAnimatedPropExplicitValues, style} = reducedProps;\n    const {style: passthroughStyle, ...passthroughProps} =\n      passthroughAnimatedPropExplicitValues ?? {};\n    const mergedStyle = [style, passthroughStyle];\n\n    return (\n      <Component\n        {...reducedProps}\n        {...passthroughProps}\n        style={mergedStyle}\n        ref={ref}\n      />\n    );\n  });\n}\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/nodes/AnimatedAddition.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport type AnimatedNode from './AnimatedNode';\n\nimport AnimatedInterpolation from './AnimatedInterpolation';\nimport AnimatedValue from './AnimatedValue';\nimport AnimatedWithChildren from './AnimatedWithChildren';\n\nimport type {PlatformConfig} from '../AnimatedPlatformConfig';\nimport type {InterpolationConfigType} from './AnimatedInterpolation';\n\nclass AnimatedAddition extends AnimatedWithChildren {\n  _a: AnimatedNode;\n  _b: AnimatedNode;\n\n  constructor(a: AnimatedNode | number, b: AnimatedNode | number) {\n    super();\n    this._a = typeof a === 'number' ? new AnimatedValue(a) : a;\n    this._b = typeof b === 'number' ? new AnimatedValue(b) : b;\n  }\n\n  __makeNative(platformConfig: ?PlatformConfig) {\n    this._a.__makeNative(platformConfig);\n    this._b.__makeNative(platformConfig);\n    super.__makeNative(platformConfig);\n  }\n\n  __getValue(): number {\n    return this._a.__getValue() + this._b.__getValue();\n  }\n\n  interpolate<OutputT: number | string>(\n    config: InterpolationConfigType<OutputT>,\n  ): AnimatedInterpolation<OutputT> {\n    return new AnimatedInterpolation(this, config);\n  }\n\n  __attach(): void {\n    this._a.__addChild(this);\n    this._b.__addChild(this);\n  }\n\n  __detach(): void {\n    this._a.__removeChild(this);\n    this._b.__removeChild(this);\n    super.__detach();\n  }\n\n  __getNativeConfig(): any {\n    return {\n      type: 'addition',\n      input: [this._a.__getNativeTag(), this._b.__getNativeTag()],\n    };\n  }\n}\n\nexport default AnimatedAddition;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/nodes/AnimatedColor.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport AnimatedValue from './AnimatedValue';\nimport AnimatedWithChildren from './AnimatedWithChildren';\nimport normalizeColor from '@react-native/normalize-colors';\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\n\nimport type {PlatformConfig} from '../AnimatedPlatformConfig';\n\ntype ColorValue = any;\ntype NativeColorValue = any;\ntype ProcessedColorValue = any;\n\nexport type AnimatedColorConfig = $ReadOnly<{\n  useNativeDriver: boolean,\n}>;\n\ntype ColorListenerCallback = (value: ColorValue) => mixed;\n\nexport type RgbaValue = {\n  +r: number,\n  +g: number,\n  +b: number,\n  +a: number,\n  ...\n};\n\ntype RgbaAnimatedValue = {\n  +r: AnimatedValue,\n  +g: AnimatedValue,\n  +b: AnimatedValue,\n  +a: AnimatedValue,\n  ...\n};\n\nconst NativeAnimatedAPI = NativeAnimatedHelper.API;\n\nconst defaultColor: RgbaValue = {r: 0, g: 0, b: 0, a: 1.0};\nlet _uniqueId = 1;\n\nconst processColorObject = (\n  color: NativeColorValue,\n): ?NativeColorValue => {\n  return color;\n};\n\n/* eslint no-bitwise: 0 */\nfunction processColor(\n  color?: ?(ColorValue | RgbaValue),\n): ?(RgbaValue | NativeColorValue) {\n  if (color === undefined || color === null) {\n    return null;\n  }\n\n  if (isRgbaValue(color)) {\n    // $FlowIgnore[incompatible-cast] - Type is verified above\n    return (color: RgbaValue);\n  }\n\n  let normalizedColor: ?ProcessedColorValue = normalizeColor(\n    // $FlowIgnore[incompatible-cast] - Type is verified above\n    (color: ColorValue),\n  );\n  if (normalizedColor === undefined || normalizedColor === null) {\n    return null;\n  }\n\n  if (typeof normalizedColor === 'object') {\n    const processedColorObj: ?NativeColorValue =\n      processColorObject(normalizedColor);\n    if (processedColorObj != null) {\n      return processedColorObj;\n    }\n  } else if (typeof normalizedColor === 'number') {\n    const r: number = (normalizedColor & 0xff000000) >>> 24;\n    const g: number = (normalizedColor & 0x00ff0000) >>> 16;\n    const b: number = (normalizedColor & 0x0000ff00) >>> 8;\n    const a: number = (normalizedColor & 0x000000ff) / 255;\n\n    return {r, g, b, a};\n  }\n\n  return null;\n}\n\nfunction isRgbaValue(value: any): boolean {\n  return (\n    value &&\n    typeof value.r === 'number' &&\n    typeof value.g === 'number' &&\n    typeof value.b === 'number' &&\n    typeof value.a === 'number'\n  );\n}\n\nfunction isRgbaAnimatedValue(value: any): boolean {\n  return (\n    value &&\n    value.r instanceof AnimatedValue &&\n    value.g instanceof AnimatedValue &&\n    value.b instanceof AnimatedValue &&\n    value.a instanceof AnimatedValue\n  );\n}\n\nexport default class AnimatedColor extends AnimatedWithChildren {\n  r: AnimatedValue;\n  g: AnimatedValue;\n  b: AnimatedValue;\n  a: AnimatedValue;\n  nativeColor: ?NativeColorValue;\n  _listeners: {\n    [key: string]: {\n      r: string,\n      g: string,\n      b: string,\n      a: string,\n      ...\n    },\n    ...\n  } = {};\n\n  constructor(\n    valueIn?: ?(RgbaValue | RgbaAnimatedValue | ColorValue),\n    config?: ?AnimatedColorConfig,\n  ) {\n    super();\n    let value: RgbaValue | RgbaAnimatedValue | ColorValue =\n      valueIn ?? defaultColor;\n    if (isRgbaAnimatedValue(value)) {\n      // $FlowIgnore[incompatible-cast] - Type is verified above\n      const rgbaAnimatedValue: RgbaAnimatedValue = (value: RgbaAnimatedValue);\n      this.r = rgbaAnimatedValue.r;\n      this.g = rgbaAnimatedValue.g;\n      this.b = rgbaAnimatedValue.b;\n      this.a = rgbaAnimatedValue.a;\n    } else {\n      const processedColor: RgbaValue | NativeColorValue =\n        // $FlowIgnore[incompatible-cast] - Type is verified above\n        processColor((value: ColorValue | RgbaValue)) ?? defaultColor;\n      let initColor: RgbaValue = defaultColor;\n      if (isRgbaValue(processedColor)) {\n        // $FlowIgnore[incompatible-cast] - Type is verified above\n        initColor = (processedColor: RgbaValue);\n      } else {\n        // $FlowIgnore[incompatible-cast] - Type is verified above\n        this.nativeColor = (processedColor: NativeColorValue);\n      }\n\n      this.r = new AnimatedValue(initColor.r);\n      this.g = new AnimatedValue(initColor.g);\n      this.b = new AnimatedValue(initColor.b);\n      this.a = new AnimatedValue(initColor.a);\n    }\n    if (this.nativeColor || (config && config.useNativeDriver)) {\n      this.__makeNative();\n    }\n  }\n\n  /**\n   * Directly set the value. This will stop any animations running on the value\n   * and update all the bound properties.\n   */\n  setValue(value: RgbaValue | ColorValue): void {\n    let shouldUpdateNodeConfig = false;\n    if (this.__isNative) {\n      const nativeTag = this.__getNativeTag();\n      NativeAnimatedAPI.setWaitingForIdentifier(nativeTag.toString());\n    }\n\n    const processedColor: RgbaValue | NativeColorValue =\n      processColor(value) ?? defaultColor;\n    if (isRgbaValue(processedColor)) {\n      // $FlowIgnore[incompatible-type] - Type is verified above\n      const rgbaValue: RgbaValue = processedColor;\n      this.r.setValue(rgbaValue.r);\n      this.g.setValue(rgbaValue.g);\n      this.b.setValue(rgbaValue.b);\n      this.a.setValue(rgbaValue.a);\n      if (this.nativeColor != null) {\n        this.nativeColor = null;\n        shouldUpdateNodeConfig = true;\n      }\n    } else {\n      // $FlowIgnore[incompatible-type] - Type is verified above\n      const nativeColor: NativeColorValue = processedColor;\n      if (this.nativeColor !== nativeColor) {\n        this.nativeColor = nativeColor;\n        shouldUpdateNodeConfig = true;\n      }\n    }\n\n    if (this.__isNative) {\n      const nativeTag = this.__getNativeTag();\n      if (shouldUpdateNodeConfig) {\n        NativeAnimatedAPI.updateAnimatedNodeConfig(\n          nativeTag,\n          this.__getNativeConfig(),\n        );\n      }\n      NativeAnimatedAPI.unsetWaitingForIdentifier(nativeTag.toString());\n    }\n  }\n\n  /**\n   * Sets an offset that is applied on top of whatever value is set, whether\n   * via `setValue`, an animation, or `Animated.event`. Useful for compensating\n   * things like the start of a pan gesture.\n   */\n  setOffset(offset: RgbaValue): void {\n    this.r.setOffset(offset.r);\n    this.g.setOffset(offset.g);\n    this.b.setOffset(offset.b);\n    this.a.setOffset(offset.a);\n  }\n\n  /**\n   * Merges the offset value into the base value and resets the offset to zero.\n   * The final output of the value is unchanged.\n   */\n  flattenOffset(): void {\n    this.r.flattenOffset();\n    this.g.flattenOffset();\n    this.b.flattenOffset();\n    this.a.flattenOffset();\n  }\n\n  /**\n   * Sets the offset value to the base value, and resets the base value to\n   * zero. The final output of the value is unchanged.\n   */\n  extractOffset(): void {\n    this.r.extractOffset();\n    this.g.extractOffset();\n    this.b.extractOffset();\n    this.a.extractOffset();\n  }\n\n  /**\n   * Adds an asynchronous listener to the value so you can observe updates from\n   * animations.  This is useful because there is no way to synchronously read\n   * the value because it might be driven natively.\n   *\n   * Returns a string that serves as an identifier for the listener.\n   */\n  addListener(callback: ColorListenerCallback): string {\n    const id = String(_uniqueId++);\n    const jointCallback = ({value: number}: any) => {\n      callback(this.__getValue());\n    };\n    this._listeners[id] = {\n      r: this.r.addListener(jointCallback),\n      g: this.g.addListener(jointCallback),\n      b: this.b.addListener(jointCallback),\n      a: this.a.addListener(jointCallback),\n    };\n    return id;\n  }\n\n  /**\n   * Unregister a listener. The `id` param shall match the identifier\n   * previously returned by `addListener()`.\n   */\n  removeListener(id: string): void {\n    this.r.removeListener(this._listeners[id].r);\n    this.g.removeListener(this._listeners[id].g);\n    this.b.removeListener(this._listeners[id].b);\n    this.a.removeListener(this._listeners[id].a);\n    delete this._listeners[id];\n  }\n\n  /**\n   * Remove all registered listeners.\n   */\n  removeAllListeners(): void {\n    this.r.removeAllListeners();\n    this.g.removeAllListeners();\n    this.b.removeAllListeners();\n    this.a.removeAllListeners();\n    this._listeners = {};\n  }\n\n  /**\n   * Stops any running animation or tracking. `callback` is invoked with the\n   * final value after stopping the animation, which is useful for updating\n   * state to match the animation position with layout.\n   */\n  stopAnimation(callback?: ColorListenerCallback): void {\n    this.r.stopAnimation();\n    this.g.stopAnimation();\n    this.b.stopAnimation();\n    this.a.stopAnimation();\n    callback && callback(this.__getValue());\n  }\n\n  /**\n   * Stops any animation and resets the value to its original.\n   */\n  resetAnimation(callback?: ColorListenerCallback): void {\n    this.r.resetAnimation();\n    this.g.resetAnimation();\n    this.b.resetAnimation();\n    this.a.resetAnimation();\n    callback && callback(this.__getValue());\n  }\n\n  __getValue(): ColorValue {\n    if (this.nativeColor != null) {\n      return this.nativeColor;\n    } else {\n      return `rgba(${this.r.__getValue()}, ${this.g.__getValue()}, ${this.b.__getValue()}, ${this.a.__getValue()})`;\n    }\n  }\n\n  __attach(): void {\n    this.r.__addChild(this);\n    this.g.__addChild(this);\n    this.b.__addChild(this);\n    this.a.__addChild(this);\n    super.__attach();\n  }\n\n  __detach(): void {\n    this.r.__removeChild(this);\n    this.g.__removeChild(this);\n    this.b.__removeChild(this);\n    this.a.__removeChild(this);\n    super.__detach();\n  }\n\n  __makeNative(platformConfig: ?PlatformConfig) {\n    this.r.__makeNative(platformConfig);\n    this.g.__makeNative(platformConfig);\n    this.b.__makeNative(platformConfig);\n    this.a.__makeNative(platformConfig);\n    super.__makeNative(platformConfig);\n  }\n\n  __getNativeConfig(): {...} {\n    return {\n      type: 'color',\n      r: this.r.__getNativeTag(),\n      g: this.g.__getNativeTag(),\n      b: this.b.__getNativeTag(),\n      a: this.a.__getNativeTag(),\n      nativeColor: this.nativeColor,\n    };\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/nodes/AnimatedDiffClamp.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport type AnimatedNode from './AnimatedNode';\n\nimport AnimatedInterpolation from './AnimatedInterpolation';\nimport AnimatedWithChildren from './AnimatedWithChildren';\n\nimport type {InterpolationConfigType} from './AnimatedInterpolation';\nimport type {PlatformConfig} from '../AnimatedPlatformConfig';\n\nclass AnimatedDiffClamp extends AnimatedWithChildren {\n  _a: AnimatedNode;\n  _min: number;\n  _max: number;\n  _value: number;\n  _lastValue: number;\n\n  constructor(a: AnimatedNode, min: number, max: number) {\n    super();\n\n    this._a = a;\n    this._min = min;\n    this._max = max;\n    this._value = this._lastValue = this._a.__getValue();\n  }\n\n  __makeNative(platformConfig: ?PlatformConfig) {\n    this._a.__makeNative(platformConfig);\n    super.__makeNative(platformConfig);\n  }\n\n  interpolate<OutputT: number | string>(\n    config: InterpolationConfigType<OutputT>,\n  ): AnimatedInterpolation<OutputT> {\n    return new AnimatedInterpolation(this, config);\n  }\n\n  __getValue(): number {\n    const value = this._a.__getValue();\n    const diff = value - this._lastValue;\n    this._lastValue = value;\n    this._value = Math.min(Math.max(this._value + diff, this._min), this._max);\n    return this._value;\n  }\n\n  __attach(): void {\n    this._a.__addChild(this);\n  }\n\n  __detach(): void {\n    this._a.__removeChild(this);\n    super.__detach();\n  }\n\n  __getNativeConfig(): any {\n    return {\n      type: 'diffclamp',\n      input: this._a.__getNativeTag(),\n      min: this._min,\n      max: this._max,\n    };\n  }\n}\n\nexport default AnimatedDiffClamp;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/nodes/AnimatedDivision.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport AnimatedInterpolation from './AnimatedInterpolation';\nimport AnimatedNode from './AnimatedNode';\nimport AnimatedValue from './AnimatedValue';\nimport AnimatedWithChildren from './AnimatedWithChildren';\n\nimport type {InterpolationConfigType} from './AnimatedInterpolation';\nimport type {PlatformConfig} from '../AnimatedPlatformConfig';\n\nclass AnimatedDivision extends AnimatedWithChildren {\n  _a: AnimatedNode;\n  _b: AnimatedNode;\n  _warnedAboutDivideByZero: boolean = false;\n\n  constructor(a: AnimatedNode | number, b: AnimatedNode | number) {\n    super();\n    if (b === 0 || (b instanceof AnimatedNode && b.__getValue() === 0)) {\n      console.error('Detected potential division by zero in AnimatedDivision');\n    }\n    this._a = typeof a === 'number' ? new AnimatedValue(a) : a;\n    this._b = typeof b === 'number' ? new AnimatedValue(b) : b;\n  }\n\n  __makeNative(platformConfig: ?PlatformConfig) {\n    this._a.__makeNative(platformConfig);\n    this._b.__makeNative(platformConfig);\n    super.__makeNative(platformConfig);\n  }\n\n  __getValue(): number {\n    const a = this._a.__getValue();\n    const b = this._b.__getValue();\n    if (b === 0) {\n      // Prevent spamming the console/LogBox\n      if (!this._warnedAboutDivideByZero) {\n        console.error('Detected division by zero in AnimatedDivision');\n        this._warnedAboutDivideByZero = true;\n      }\n      // Passing infinity/NaN to Fabric will cause a native crash\n      return 0;\n    }\n    this._warnedAboutDivideByZero = false;\n    return a / b;\n  }\n\n  interpolate<OutputT: number | string>(\n    config: InterpolationConfigType<OutputT>,\n  ): AnimatedInterpolation<OutputT> {\n    return new AnimatedInterpolation(this, config);\n  }\n\n  __attach(): void {\n    this._a.__addChild(this);\n    this._b.__addChild(this);\n  }\n\n  __detach(): void {\n    this._a.__removeChild(this);\n    this._b.__removeChild(this);\n    super.__detach();\n  }\n\n  __getNativeConfig(): any {\n    return {\n      type: 'division',\n      input: [this._a.__getNativeTag(), this._b.__getNativeTag()],\n    };\n  }\n}\n\nexport default AnimatedDivision;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/nodes/AnimatedInterpolation.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n/* eslint no-bitwise: 0 */\n\n'use strict';\n\nimport type AnimatedNode from './AnimatedNode';\n\nimport AnimatedWithChildren from './AnimatedWithChildren';\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\n\nimport invariant from 'fbjs/lib/invariant';\nimport normalizeColor from '@react-native/normalize-colors';\n\nimport type {PlatformConfig} from '../AnimatedPlatformConfig';\n\nconst __DEV__ = process.env.NODE_ENV !== 'production';\n\ntype ExtrapolateType = 'extend' | 'identity' | 'clamp';\n\nexport type InterpolationConfigType<OutputT: number | string> = $ReadOnly<{\n  inputRange: $ReadOnlyArray<number>,\n  outputRange: $ReadOnlyArray<OutputT>,\n  easing?: (input: number) => number,\n  extrapolate?: ExtrapolateType,\n  extrapolateLeft?: ExtrapolateType,\n  extrapolateRight?: ExtrapolateType,\n}>;\n\nconst linear = (t: number) => t;\n\n/**\n * Very handy helper to map input ranges to output ranges with an easing\n * function and custom behavior outside of the ranges.\n */\nfunction createInterpolation<OutputT: number | string>(\n  config: InterpolationConfigType<OutputT>,\n): (input: number) => OutputT {\n  if (config.outputRange && typeof config.outputRange[0] === 'string') {\n    return (createInterpolationFromStringOutputRange((config: any)): any);\n  }\n\n  const outputRange: $ReadOnlyArray<number> = (config.outputRange: any);\n\n  const inputRange = config.inputRange;\n\n  if (__DEV__) {\n    checkInfiniteRange('outputRange', outputRange);\n    checkInfiniteRange('inputRange', inputRange);\n    checkValidInputRange(inputRange);\n\n    invariant(\n      inputRange.length === outputRange.length,\n      'inputRange (' +\n        inputRange.length +\n        ') and outputRange (' +\n        outputRange.length +\n        ') must have the same length',\n    );\n  }\n\n  const easing = config.easing || linear;\n\n  let extrapolateLeft: ExtrapolateType = 'extend';\n  if (config.extrapolateLeft !== undefined) {\n    extrapolateLeft = config.extrapolateLeft;\n  } else if (config.extrapolate !== undefined) {\n    extrapolateLeft = config.extrapolate;\n  }\n\n  let extrapolateRight: ExtrapolateType = 'extend';\n  if (config.extrapolateRight !== undefined) {\n    extrapolateRight = config.extrapolateRight;\n  } else if (config.extrapolate !== undefined) {\n    extrapolateRight = config.extrapolate;\n  }\n\n  return input => {\n    invariant(\n      typeof input === 'number',\n      'Cannot interpolation an input which is not a number',\n    );\n\n    const range = findRange(input, inputRange);\n    return (interpolate(\n      input,\n      inputRange[range],\n      inputRange[range + 1],\n      outputRange[range],\n      outputRange[range + 1],\n      easing,\n      extrapolateLeft,\n      extrapolateRight,\n    ): any);\n  };\n}\n\nfunction interpolate(\n  input: number,\n  inputMin: number,\n  inputMax: number,\n  outputMin: number,\n  outputMax: number,\n  easing: (input: number) => number,\n  extrapolateLeft: ExtrapolateType,\n  extrapolateRight: ExtrapolateType,\n) {\n  let result = input;\n\n  // Extrapolate\n  if (result < inputMin) {\n    if (extrapolateLeft === 'identity') {\n      return result;\n    } else if (extrapolateLeft === 'clamp') {\n      result = inputMin;\n    } else if (extrapolateLeft === 'extend') {\n      // noop\n    }\n  }\n\n  if (result > inputMax) {\n    if (extrapolateRight === 'identity') {\n      return result;\n    } else if (extrapolateRight === 'clamp') {\n      result = inputMax;\n    } else if (extrapolateRight === 'extend') {\n      // noop\n    }\n  }\n\n  if (outputMin === outputMax) {\n    return outputMin;\n  }\n\n  if (inputMin === inputMax) {\n    if (input <= inputMin) {\n      return outputMin;\n    }\n    return outputMax;\n  }\n\n  // Input Range\n  if (inputMin === -Infinity) {\n    result = -result;\n  } else if (inputMax === Infinity) {\n    result = result - inputMin;\n  } else {\n    result = (result - inputMin) / (inputMax - inputMin);\n  }\n\n  // Easing\n  result = easing(result);\n\n  // Output Range\n  if (outputMin === -Infinity) {\n    result = -result;\n  } else if (outputMax === Infinity) {\n    result = result + outputMin;\n  } else {\n    result = result * (outputMax - outputMin) + outputMin;\n  }\n\n  return result;\n}\n\nfunction colorToRgba(input: string): string {\n  let normalizedColor = normalizeColor(input);\n  if (normalizedColor === null || typeof normalizedColor !== 'number') {\n    return input;\n  }\n\n  normalizedColor = normalizedColor || 0;\n\n  const r = (normalizedColor & 0xff000000) >>> 24;\n  const g = (normalizedColor & 0x00ff0000) >>> 16;\n  const b = (normalizedColor & 0x0000ff00) >>> 8;\n  const a = (normalizedColor & 0x000000ff) / 255;\n\n  return `rgba(${r}, ${g}, ${b}, ${a})`;\n}\n\nconst stringShapeRegex = /[+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:[eE][+-]?\\d+)?/g;\n\n/**\n * Supports string shapes by extracting numbers so new values can be computed,\n * and recombines those values into new strings of the same shape.  Supports\n * things like:\n *\n *   rgba(123, 42, 99, 0.36) // colors\n *   -45deg                  // values with units\n */\nfunction createInterpolationFromStringOutputRange(\n  config: InterpolationConfigType<string>,\n): (input: number) => string {\n  let outputRange: Array<string> = (config.outputRange: any);\n  invariant(outputRange.length >= 2, 'Bad output range');\n  outputRange = outputRange.map(colorToRgba);\n  checkPattern(outputRange);\n\n  // ['rgba(0, 100, 200, 0)', 'rgba(50, 150, 250, 0.5)']\n  // ->\n  // [\n  //   [0, 50],\n  //   [100, 150],\n  //   [200, 250],\n  //   [0, 0.5],\n  // ]\n  /* $FlowFixMe[incompatible-use] (>=0.18.0): `outputRange[0].match()` can\n   * return `null`. Need to guard against this possibility. */\n  const outputRanges = outputRange[0].match(stringShapeRegex).map(() => []);\n  outputRange.forEach(value => {\n    /* $FlowFixMe[incompatible-use] (>=0.18.0): `value.match()` can return\n     * `null`. Need to guard against this possibility. */\n    value.match(stringShapeRegex).forEach((number, i) => {\n      outputRanges[i].push(+number);\n    });\n  });\n\n  const interpolations = outputRange[0]\n    .match(stringShapeRegex)\n    /* $FlowFixMe[incompatible-use] (>=0.18.0): `outputRange[0].match()` can\n     * return `null`. Need to guard against this possibility. */\n    /* $FlowFixMe[incompatible-call] (>=0.18.0): `outputRange[0].match()` can\n     * return `null`. Need to guard against this possibility. */\n    .map((value, i) => {\n      return createInterpolation({\n        ...config,\n        outputRange: outputRanges[i],\n      });\n    });\n\n  // rgba requires that the r,g,b are integers.... so we want to round them, but we *dont* want to\n  // round the opacity (4th column).\n  const shouldRound = isRgbOrRgba(outputRange[0]);\n\n  return input => {\n    let i = 0;\n    // 'rgba(0, 100, 200, 0)'\n    // ->\n    // 'rgba(${interpolations[0](input)}, ${interpolations[1](input)}, ...'\n    return outputRange[0].replace(stringShapeRegex, () => {\n      let val = +interpolations[i++](input);\n      if (shouldRound) {\n        val = i < 4 ? Math.round(val) : Math.round(val * 1000) / 1000;\n      }\n      return String(val);\n    });\n  };\n}\n\nfunction isRgbOrRgba(range: string) {\n  return typeof range === 'string' && range.startsWith('rgb');\n}\n\nfunction checkPattern(arr: $ReadOnlyArray<string>) {\n  const pattern = arr[0].replace(stringShapeRegex, '');\n  for (let i = 1; i < arr.length; ++i) {\n    invariant(\n      pattern === arr[i].replace(stringShapeRegex, ''),\n      'invalid pattern ' + arr[0] + ' and ' + arr[i],\n    );\n  }\n}\n\nfunction findRange(input: number, inputRange: $ReadOnlyArray<number>) {\n  let i;\n  for (i = 1; i < inputRange.length - 1; ++i) {\n    if (inputRange[i] >= input) {\n      break;\n    }\n  }\n  return i - 1;\n}\n\nfunction checkValidInputRange(arr: $ReadOnlyArray<number>) {\n  invariant(arr.length >= 2, 'inputRange must have at least 2 elements');\n  const message =\n    'inputRange must be monotonically non-decreasing ' + String(arr);\n  for (let i = 1; i < arr.length; ++i) {\n    invariant(arr[i] >= arr[i - 1], message);\n  }\n}\n\nfunction checkInfiniteRange(name: string, arr: $ReadOnlyArray<number>) {\n  invariant(arr.length >= 2, name + ' must have at least 2 elements');\n  invariant(\n    arr.length !== 2 || arr[0] !== -Infinity || arr[1] !== Infinity,\n    /* $FlowFixMe[incompatible-type] (>=0.13.0) - In the addition expression\n     * below this comment, one or both of the operands may be something that\n     * doesn't cleanly convert to a string, like undefined, null, and object,\n     * etc. If you really mean this implicit string conversion, you can do\n     * something like String(myThing) */\n    name + 'cannot be ]-infinity;+infinity[ ' + arr,\n  );\n}\n\nclass AnimatedInterpolation<\n  OutputT: number | string,\n> extends AnimatedWithChildren {\n  // Export for testing.\n  static __createInterpolation: (\n    config: InterpolationConfigType<OutputT>,\n  ) => (input: number) => OutputT = createInterpolation;\n\n  _parent: AnimatedNode;\n  _config: InterpolationConfigType<OutputT>;\n  _interpolation: (input: number) => OutputT;\n\n  constructor(parent: AnimatedNode, config: InterpolationConfigType<OutputT>) {\n    super();\n    this._parent = parent;\n    this._config = config;\n    this._interpolation = createInterpolation(config);\n  }\n\n  __makeNative(platformConfig: ?PlatformConfig) {\n    this._parent.__makeNative(platformConfig);\n    super.__makeNative(platformConfig);\n  }\n\n  __getValue(): number | string {\n    const parentValue: number = this._parent.__getValue();\n    invariant(\n      typeof parentValue === 'number',\n      'Cannot interpolate an input which is not a number.',\n    );\n    return this._interpolation(parentValue);\n  }\n\n  interpolate<NewOutputT: number | string>(\n    config: InterpolationConfigType<NewOutputT>,\n  ): AnimatedInterpolation<NewOutputT> {\n    return new AnimatedInterpolation(this, config);\n  }\n\n  __attach(): void {\n    this._parent.__addChild(this);\n  }\n\n  __detach(): void {\n    this._parent.__removeChild(this);\n    super.__detach();\n  }\n\n  __transformDataType(range: $ReadOnlyArray<OutputT>): Array<any> {\n    return range.map(NativeAnimatedHelper.transformDataType);\n  }\n\n  __getNativeConfig(): any {\n    if (__DEV__) {\n      NativeAnimatedHelper.validateInterpolation(this._config);\n    }\n\n    return {\n      inputRange: this._config.inputRange,\n      // Only the `outputRange` can contain strings so we don't need to transform `inputRange` here\n      outputRange: this.__transformDataType(this._config.outputRange),\n      extrapolateLeft:\n        this._config.extrapolateLeft || this._config.extrapolate || 'extend',\n      extrapolateRight:\n        this._config.extrapolateRight || this._config.extrapolate || 'extend',\n      type: 'interpolation',\n    };\n  }\n}\n\nexport default AnimatedInterpolation;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/nodes/AnimatedModulo.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport type AnimatedNode from './AnimatedNode';\n\nimport AnimatedInterpolation from './AnimatedInterpolation';\nimport AnimatedWithChildren from './AnimatedWithChildren';\n\nimport type {InterpolationConfigType} from './AnimatedInterpolation';\nimport type {PlatformConfig} from '../AnimatedPlatformConfig';\n\nclass AnimatedModulo extends AnimatedWithChildren {\n  _a: AnimatedNode;\n  _modulus: number;\n\n  constructor(a: AnimatedNode, modulus: number) {\n    super();\n    this._a = a;\n    this._modulus = modulus;\n  }\n\n  __makeNative(platformConfig: ?PlatformConfig) {\n    this._a.__makeNative(platformConfig);\n    super.__makeNative(platformConfig);\n  }\n\n  __getValue(): number {\n    return (\n      ((this._a.__getValue() % this._modulus) + this._modulus) % this._modulus\n    );\n  }\n\n  interpolate<OutputT: number | string>(\n    config: InterpolationConfigType<OutputT>,\n  ): AnimatedInterpolation<OutputT> {\n    return new AnimatedInterpolation(this, config);\n  }\n\n  __attach(): void {\n    this._a.__addChild(this);\n  }\n\n  __detach(): void {\n    this._a.__removeChild(this);\n    super.__detach();\n  }\n\n  __getNativeConfig(): any {\n    return {\n      type: 'modulus',\n      input: this._a.__getNativeTag(),\n      modulus: this._modulus,\n    };\n  }\n}\n\nexport default AnimatedModulo;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/nodes/AnimatedMultiplication.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport type AnimatedNode from './AnimatedNode';\n\nimport AnimatedInterpolation from './AnimatedInterpolation';\nimport AnimatedValue from './AnimatedValue';\nimport AnimatedWithChildren from './AnimatedWithChildren';\n\nimport type {InterpolationConfigType} from './AnimatedInterpolation';\nimport type {PlatformConfig} from '../AnimatedPlatformConfig';\n\nclass AnimatedMultiplication extends AnimatedWithChildren {\n  _a: AnimatedNode;\n  _b: AnimatedNode;\n\n  constructor(a: AnimatedNode | number, b: AnimatedNode | number) {\n    super();\n    this._a = typeof a === 'number' ? new AnimatedValue(a) : a;\n    this._b = typeof b === 'number' ? new AnimatedValue(b) : b;\n  }\n\n  __makeNative(platformConfig: ?PlatformConfig) {\n    this._a.__makeNative(platformConfig);\n    this._b.__makeNative(platformConfig);\n    super.__makeNative(platformConfig);\n  }\n\n  __getValue(): number {\n    return this._a.__getValue() * this._b.__getValue();\n  }\n\n  interpolate<OutputT: number | string>(\n    config: InterpolationConfigType<OutputT>,\n  ): AnimatedInterpolation<OutputT> {\n    return new AnimatedInterpolation(this, config);\n  }\n  __attach(): void {\n    this._a.__addChild(this);\n    this._b.__addChild(this);\n  }\n\n  __detach(): void {\n    this._a.__removeChild(this);\n    this._b.__removeChild(this);\n    super.__detach();\n  }\n\n  __getNativeConfig(): any {\n    return {\n      type: 'multiplication',\n      input: [this._a.__getNativeTag(), this._b.__getNativeTag()],\n    };\n  }\n}\n\nexport default AnimatedMultiplication;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/nodes/AnimatedNode.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\n\nconst NativeAnimatedAPI = NativeAnimatedHelper.API;\nimport invariant from 'fbjs/lib/invariant';\n\nimport type {PlatformConfig} from '../AnimatedPlatformConfig';\n\ntype ValueListenerCallback = (state: {value: number, ...}) => mixed;\n\nlet _uniqueId = 1;\n\n// Note(vjeux): this would be better as an interface but flow doesn't\n// support them yet\nclass AnimatedNode {\n  _listeners: {[key: string]: ValueListenerCallback, ...};\n  _platformConfig: ?PlatformConfig;\n  __nativeAnimatedValueListener: ?any;\n  __attach(): void {}\n  __detach(): void {\n    if (this.__isNative && this.__nativeTag != null) {\n      NativeAnimatedHelper.API.dropAnimatedNode(this.__nativeTag);\n      this.__nativeTag = undefined;\n    }\n  }\n  __getValue(): any {}\n  __getAnimatedValue(): any {\n    return this.__getValue();\n  }\n  __addChild(child: AnimatedNode) {}\n  __removeChild(child: AnimatedNode) {}\n  __getChildren(): Array<AnimatedNode> {\n    return [];\n  }\n\n  /* Methods and props used by native Animated impl */\n  __isNative: boolean;\n  __nativeTag: ?number;\n  __shouldUpdateListenersForNewNativeTag: boolean;\n\n  constructor() {\n    this._listeners = {};\n  }\n\n  __makeNative(platformConfig: ?PlatformConfig): void {\n    if (!this.__isNative) {\n      throw new Error('This node cannot be made a \"native\" animated node');\n    }\n\n    this._platformConfig = platformConfig;\n    if (this.hasListeners()) {\n      this._startListeningToNativeValueUpdates();\n    }\n  }\n\n  /**\n   * Adds an asynchronous listener to the value so you can observe updates from\n   * animations.  This is useful because there is no way to\n   * synchronously read the value because it might be driven natively.\n   *\n   * See https://reactnative.dev/docs/animatedvalue#addlistener\n   */\n  addListener(callback: (value: any) => mixed): string {\n    const id = String(_uniqueId++);\n    this._listeners[id] = callback;\n    if (this.__isNative) {\n      this._startListeningToNativeValueUpdates();\n    }\n    return id;\n  }\n\n  /**\n   * Unregister a listener. The `id` param shall match the identifier\n   * previously returned by `addListener()`.\n   *\n   * See https://reactnative.dev/docs/animatedvalue#removelistener\n   */\n  removeListener(id: string): void {\n    delete this._listeners[id];\n    if (this.__isNative && !this.hasListeners()) {\n      this._stopListeningForNativeValueUpdates();\n    }\n  }\n\n  /**\n   * Remove all registered listeners.\n   *\n   * See https://reactnative.dev/docs/animatedvalue#removealllisteners\n   */\n  removeAllListeners(): void {\n    this._listeners = {};\n    if (this.__isNative) {\n      this._stopListeningForNativeValueUpdates();\n    }\n  }\n\n  hasListeners(): boolean {\n    return !!Object.keys(this._listeners).length;\n  }\n\n  _startListeningToNativeValueUpdates() {\n    if (\n      this.__nativeAnimatedValueListener &&\n      !this.__shouldUpdateListenersForNewNativeTag\n    ) {\n      return;\n    }\n\n    if (this.__shouldUpdateListenersForNewNativeTag) {\n      this.__shouldUpdateListenersForNewNativeTag = false;\n      this._stopListeningForNativeValueUpdates();\n    }\n\n    NativeAnimatedAPI.startListeningToAnimatedNodeValue(this.__getNativeTag());\n    this.__nativeAnimatedValueListener =\n      NativeAnimatedHelper.nativeEventEmitter.addListener(\n        'onAnimatedValueUpdate',\n        data => {\n          if (data.tag !== this.__getNativeTag()) {\n            return;\n          }\n          this.__onAnimatedValueUpdateReceived(data.value);\n        },\n      );\n  }\n\n  __onAnimatedValueUpdateReceived(value: number) {\n    this.__callListeners(value);\n  }\n\n  __callListeners(value: number): void {\n    for (const key in this._listeners) {\n      this._listeners[key]({value});\n    }\n  }\n\n  _stopListeningForNativeValueUpdates() {\n    if (!this.__nativeAnimatedValueListener) {\n      return;\n    }\n\n    this.__nativeAnimatedValueListener.remove();\n    this.__nativeAnimatedValueListener = null;\n    NativeAnimatedAPI.stopListeningToAnimatedNodeValue(this.__getNativeTag());\n  }\n\n  __getNativeTag(): number {\n    NativeAnimatedHelper.assertNativeAnimatedModule();\n    invariant(\n      this.__isNative,\n      'Attempt to get native tag from node not marked as \"native\"',\n    );\n\n    const nativeTag =\n      this.__nativeTag ?? NativeAnimatedHelper.generateNewNodeTag();\n\n    if (this.__nativeTag == null) {\n      this.__nativeTag = nativeTag;\n      const config = this.__getNativeConfig();\n      if (this._platformConfig) {\n        config.platformConfig = this._platformConfig;\n      }\n      NativeAnimatedHelper.API.createAnimatedNode(nativeTag, config);\n      this.__shouldUpdateListenersForNewNativeTag = true;\n    }\n\n    return nativeTag;\n  }\n  __getNativeConfig(): Object {\n    throw new Error(\n      'This JS animated node type cannot be used as native animated node',\n    );\n  }\n  toJSON(): any {\n    return this.__getValue();\n  }\n\n  __getPlatformConfig(): ?PlatformConfig {\n    return this._platformConfig;\n  }\n  __setPlatformConfig(platformConfig: ?PlatformConfig) {\n    this._platformConfig = platformConfig;\n  }\n}\n\nexport default AnimatedNode;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/nodes/AnimatedProps.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport {AnimatedEvent} from '../AnimatedEvent';\nimport AnimatedNode from './AnimatedNode';\nimport AnimatedStyle from './AnimatedStyle';\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\n\nimport invariant from 'fbjs/lib/invariant';\n\nclass AnimatedProps extends AnimatedNode {\n  _props: Object;\n  _animatedView: any;\n  _callback: () => void;\n\n  constructor(props: Object, callback: () => void) {\n    super();\n    if (props.style) {\n      props = {\n        ...props,\n        style: new AnimatedStyle(props.style),\n      };\n    }\n    this._props = props;\n    this._callback = callback;\n  }\n\n  __getValue(): Object {\n    const props = {};\n    for (const key in this._props) {\n      const value = this._props[key];\n      if (value instanceof AnimatedNode) {\n        if (!value.__isNative || value instanceof AnimatedStyle) {\n          // We cannot use value of natively driven nodes this way as the value we have access from\n          // JS may not be up to date.\n          props[key] = value.__getValue();\n        }\n      } else if (value instanceof AnimatedEvent) {\n        props[key] = value.__getHandler();\n      } else {\n        props[key] = value;\n      }\n    }\n    return props;\n  }\n\n  __getAnimatedValue(): Object {\n    const props = {};\n    for (const key in this._props) {\n      const value = this._props[key];\n      if (value instanceof AnimatedNode) {\n        props[key] = value.__getAnimatedValue();\n      }\n    }\n    return props;\n  }\n\n  __attach(): void {\n    for (const key in this._props) {\n      const value = this._props[key];\n      if (value instanceof AnimatedNode) {\n        value.__addChild(this);\n      }\n    }\n  }\n\n  __detach(): void {\n    if (this.__isNative && this._animatedView) {\n      this.__disconnectAnimatedView();\n    }\n    this._animatedView = null;\n    for (const key in this._props) {\n      const value = this._props[key];\n      if (value instanceof AnimatedNode) {\n        value.__removeChild(this);\n      }\n    }\n    super.__detach();\n  }\n\n  update(): void {\n    this._callback();\n  }\n\n  __makeNative(): void {\n    if (!this.__isNative) {\n      this.__isNative = true;\n      for (const key in this._props) {\n        const value = this._props[key];\n        if (value instanceof AnimatedNode) {\n          value.__makeNative();\n        }\n      }\n      if (this._animatedView) {\n        this.__connectAnimatedView();\n      }\n    }\n  }\n\n  setNativeView(animatedView: any): void {\n    if (this._animatedView === animatedView) {\n      return;\n    }\n    this._animatedView = animatedView;\n    if (this.__isNative) {\n      this.__connectAnimatedView();\n    }\n  }\n\n  __connectAnimatedView(): void {\n    invariant(this.__isNative, 'Expected node to be marked as \"native\"');\n    const nativeViewTag: ?number = this._animatedView\n    invariant(\n      nativeViewTag != null,\n      'Unable to locate attached view in the native tree',\n    );\n    NativeAnimatedHelper.API.connectAnimatedNodeToView(\n      this.__getNativeTag(),\n      nativeViewTag,\n    );\n  }\n\n  __disconnectAnimatedView(): void {\n    invariant(this.__isNative, 'Expected node to be marked as \"native\"');\n    const nativeViewTag: ?number = this._animatedView\n    invariant(\n      nativeViewTag != null,\n      'Unable to locate attached view in the native tree',\n    );\n    NativeAnimatedHelper.API.disconnectAnimatedNodeFromView(\n      this.__getNativeTag(),\n      nativeViewTag,\n    );\n  }\n\n  __restoreDefaultValues(): void {\n    // When using the native driver, view properties need to be restored to\n    // their default values manually since react no longer tracks them. This\n    // is needed to handle cases where a prop driven by native animated is removed\n    // after having been changed natively by an animation.\n    if (this.__isNative) {\n      NativeAnimatedHelper.API.restoreDefaultValues(this.__getNativeTag());\n    }\n  }\n\n  __getNativeConfig(): Object {\n    const propsConfig = {};\n    for (const propKey in this._props) {\n      const value = this._props[propKey];\n      if (value instanceof AnimatedNode) {\n        value.__makeNative();\n        propsConfig[propKey] = value.__getNativeTag();\n      }\n    }\n    return {\n      type: 'props',\n      props: propsConfig,\n    };\n  }\n}\n\nexport default AnimatedProps;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/nodes/AnimatedStyle.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport AnimatedNode from './AnimatedNode';\nimport AnimatedTransform from './AnimatedTransform';\nimport AnimatedWithChildren from './AnimatedWithChildren';\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\n\nimport StyleSheet from '../../../../exports/StyleSheet';\n\nconst flattenStyle = StyleSheet.flatten;\n\nfunction createAnimatedStyle(inputStyle: any): Object {\n  const style = flattenStyle(inputStyle);\n  const animatedStyles = {}\n  for (const key in style) {\n    const value = style[key];\n    if (key === 'transform' && Array.isArray(value)) {\n      animatedStyles[key] = new AnimatedTransform(value);\n    }\n    else if (value instanceof AnimatedNode) {\n      animatedStyles[key] = value;\n    }\n    else if (value && !Array.isArray(value) && typeof value === 'object') {\n      animatedStyles[key] = createAnimatedStyle(value);\n    }\n  }\n  return animatedStyles;\n}\n\nclass AnimatedStyle extends AnimatedWithChildren {\n  _inputStyle: any;\n  _style: Object;\n\n  constructor(style: any) {\n    super();\n    this._inputStyle = style;\n    this._style = createAnimatedStyle(style);\n  }\n\n  // Recursively get values for nested styles (like iOS's shadowOffset)\n  _walkStyleAndGetValues(style) {\n    const updatedStyle = {};\n    for (const key in style) {\n      const value = style[key];\n      if (value instanceof AnimatedNode) {\n        if (!value.__isNative) {\n          // We cannot use value of natively driven nodes this way as the value we have access from\n          // JS may not be up to date.\n          updatedStyle[key] = value.__getValue();\n        }\n      } else if (value && !Array.isArray(value) && typeof value === 'object') {\n        // Support animating nested values (for example: shadowOffset.height)\n        updatedStyle[key] = this._walkStyleAndGetValues(value);\n      } else {\n        updatedStyle[key] = value;\n      }\n    }\n    return updatedStyle;\n  }\n\n  __getValue(): Array<Object> {\n    return [\n      this._inputStyle,\n      this._walkStyleAndGetValues(this._style)\n    ];\n  }\n\n  // Recursively get animated values for nested styles (like iOS's shadowOffset)\n  _walkStyleAndGetAnimatedValues(style) {\n    const updatedStyle = {};\n    for (const key in style) {\n      const value = style[key];\n      if (value instanceof AnimatedNode) {\n        updatedStyle[key] = value.__getAnimatedValue();\n      } else if (value && !Array.isArray(value) && typeof value === 'object') {\n        // Support animating nested values (for example: shadowOffset.height)\n        updatedStyle[key] = this._walkStyleAndGetAnimatedValues(value);\n      }\n    }\n    return updatedStyle;\n  }\n\n  __getAnimatedValue(): Object {\n    return this._walkStyleAndGetAnimatedValues(this._style);\n  }\n\n  __attach(): void {\n    for (const key in this._style) {\n      const value = this._style[key];\n      if (value instanceof AnimatedNode) {\n        value.__addChild(this);\n      }\n    }\n  }\n\n  __detach(): void {\n    for (const key in this._style) {\n      const value = this._style[key];\n      if (value instanceof AnimatedNode) {\n        value.__removeChild(this);\n      }\n    }\n    super.__detach();\n  }\n\n  __makeNative() {\n    for (const key in this._style) {\n      const value = this._style[key];\n      if (value instanceof AnimatedNode) {\n        value.__makeNative();\n      }\n    }\n    super.__makeNative();\n  }\n\n  __getNativeConfig(): Object {\n    const styleConfig = {};\n    for (const styleKey in this._style) {\n      if (this._style[styleKey] instanceof AnimatedNode) {\n        const style = this._style[styleKey];\n        style.__makeNative();\n        styleConfig[styleKey] = style.__getNativeTag();\n      }\n    }\n    NativeAnimatedHelper.validateStyles(styleConfig);\n    return {\n      type: 'style',\n      style: styleConfig,\n    };\n  }\n}\n\nexport default AnimatedStyle;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/nodes/AnimatedSubtraction.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport type AnimatedNode from './AnimatedNode';\nimport type {InterpolationConfigType} from './AnimatedInterpolation';\nimport type {PlatformConfig} from '../AnimatedPlatformConfig';\n\nimport AnimatedInterpolation from './AnimatedInterpolation';\nimport AnimatedValue from './AnimatedValue';\nimport AnimatedWithChildren from './AnimatedWithChildren';\n\nclass AnimatedSubtraction extends AnimatedWithChildren {\n  _a: AnimatedNode;\n  _b: AnimatedNode;\n\n  constructor(a: AnimatedNode | number, b: AnimatedNode | number) {\n    super();\n    this._a = typeof a === 'number' ? new AnimatedValue(a) : a;\n    this._b = typeof b === 'number' ? new AnimatedValue(b) : b;\n  }\n\n  __makeNative(platformConfig: ?PlatformConfig) {\n    this._a.__makeNative(platformConfig);\n    this._b.__makeNative(platformConfig);\n    super.__makeNative(platformConfig);\n  }\n\n  __getValue(): number {\n    return this._a.__getValue() - this._b.__getValue();\n  }\n\n  interpolate<OutputT: number | string>(\n    config: InterpolationConfigType<OutputT>,\n  ): AnimatedInterpolation<OutputT> {\n    return new AnimatedInterpolation(this, config);\n  }\n\n  __attach(): void {\n    this._a.__addChild(this);\n    this._b.__addChild(this);\n  }\n\n  __detach(): void {\n    this._a.__removeChild(this);\n    this._b.__removeChild(this);\n    super.__detach();\n  }\n\n  __getNativeConfig(): any {\n    return {\n      type: 'subtraction',\n      input: [this._a.__getNativeTag(), this._b.__getNativeTag()],\n    };\n  }\n}\n\nexport default AnimatedSubtraction;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/nodes/AnimatedTracking.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport AnimatedValue from './AnimatedValue';\nimport AnimatedNode from './AnimatedNode';\nimport {\n  generateNewAnimationId,\n  shouldUseNativeDriver,\n} from '../NativeAnimatedHelper';\n\nimport type {EndCallback} from '../animations/Animation';\n\nclass AnimatedTracking extends AnimatedNode {\n  _value: AnimatedValue;\n  _parent: AnimatedNode;\n  _callback: ?EndCallback;\n  _animationConfig: Object;\n  _animationClass: any;\n  _useNativeDriver: boolean;\n\n  constructor(\n    value: AnimatedValue,\n    parent: AnimatedNode,\n    animationClass: any,\n    animationConfig: Object,\n    callback?: ?EndCallback,\n  ) {\n    super();\n    this._value = value;\n    this._parent = parent;\n    this._animationClass = animationClass;\n    this._animationConfig = animationConfig;\n    this._useNativeDriver = shouldUseNativeDriver(animationConfig);\n    this._callback = callback;\n    this.__attach();\n  }\n\n  __makeNative() {\n    this.__isNative = true;\n    this._parent.__makeNative();\n    super.__makeNative();\n    this._value.__makeNative();\n  }\n\n  __getValue(): Object {\n    return this._parent.__getValue();\n  }\n\n  __attach(): void {\n    this._parent.__addChild(this);\n    if (this._useNativeDriver) {\n      // when the tracking starts we need to convert this node to a \"native node\"\n      // so that the parent node will be made \"native\" too. This is necessary as\n      // if we don't do this `update` method will get called. At that point it\n      // may be too late as it would mean the JS driver has already started\n      // updating node values\n      this.__makeNative();\n    }\n  }\n\n  __detach(): void {\n    this._parent.__removeChild(this);\n    super.__detach();\n  }\n\n  update(): void {\n    this._value.animate(\n      new this._animationClass({\n        ...this._animationConfig,\n        toValue: (this._animationConfig.toValue: any).__getValue(),\n      }),\n      this._callback,\n    );\n  }\n\n  __getNativeConfig(): any {\n    const animation = new this._animationClass({\n      ...this._animationConfig,\n      // remove toValue from the config as it's a ref to Animated.Value\n      toValue: undefined,\n    });\n    const animationConfig = animation.__getNativeAnimationConfig();\n    return {\n      type: 'tracking',\n      animationId: generateNewAnimationId(),\n      animationConfig,\n      toValue: this._parent.__getNativeTag(),\n      value: this._value.__getNativeTag(),\n    };\n  }\n}\n\nexport default AnimatedTracking;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/nodes/AnimatedTransform.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport AnimatedNode from './AnimatedNode';\nimport AnimatedWithChildren from './AnimatedWithChildren';\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\n\nclass AnimatedTransform extends AnimatedWithChildren {\n  _transforms: $ReadOnlyArray<Object>;\n\n  constructor(transforms: $ReadOnlyArray<Object>) {\n    super();\n    this._transforms = transforms;\n  }\n\n  __makeNative() {\n    this._transforms.forEach(transform => {\n      for (const key in transform) {\n        const value = transform[key];\n        if (value instanceof AnimatedNode) {\n          value.__makeNative();\n        }\n      }\n    });\n    super.__makeNative();\n  }\n\n  __getValue(): $ReadOnlyArray<Object> {\n    return this._transforms.map(transform => {\n      const result = {};\n      for (const key in transform) {\n        const value = transform[key];\n        if (value instanceof AnimatedNode) {\n          result[key] = value.__getValue();\n        } else {\n          result[key] = value;\n        }\n      }\n      return result;\n    });\n  }\n\n  __getAnimatedValue(): $ReadOnlyArray<Object> {\n    return this._transforms.map(transform => {\n      const result = {};\n      for (const key in transform) {\n        const value = transform[key];\n        if (value instanceof AnimatedNode) {\n          result[key] = value.__getAnimatedValue();\n        } else {\n          // All transform components needed to recompose matrix\n          result[key] = value;\n        }\n      }\n      return result;\n    });\n  }\n\n  __attach(): void {\n    this._transforms.forEach(transform => {\n      for (const key in transform) {\n        const value = transform[key];\n        if (value instanceof AnimatedNode) {\n          value.__addChild(this);\n        }\n      }\n    });\n  }\n\n  __detach(): void {\n    this._transforms.forEach(transform => {\n      for (const key in transform) {\n        const value = transform[key];\n        if (value instanceof AnimatedNode) {\n          value.__removeChild(this);\n        }\n      }\n    });\n    super.__detach();\n  }\n\n  __getNativeConfig(): any {\n    const transConfigs = [];\n\n    this._transforms.forEach(transform => {\n      for (const key in transform) {\n        const value = transform[key];\n        if (value instanceof AnimatedNode) {\n          transConfigs.push({\n            type: 'animated',\n            property: key,\n            nodeTag: value.__getNativeTag(),\n          });\n        } else {\n          transConfigs.push({\n            type: 'static',\n            property: key,\n            value: NativeAnimatedHelper.transformDataType(value),\n          });\n        }\n      }\n    });\n\n    NativeAnimatedHelper.validateTransform(transConfigs);\n    return {\n      type: 'transform',\n      transforms: transConfigs,\n    };\n  }\n}\n\nexport default AnimatedTransform;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/nodes/AnimatedValue.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport AnimatedInterpolation from './AnimatedInterpolation';\nimport AnimatedWithChildren from './AnimatedWithChildren';\nimport InteractionManager from '../../../../exports/InteractionManager';\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\n\nimport type AnimatedNode from './AnimatedNode';\nimport type Animation, {EndCallback} from '../animations/Animation';\nimport type {InterpolationConfigType} from './AnimatedInterpolation';\nimport type AnimatedTracking from './AnimatedTracking';\n\nexport type AnimatedValueConfig = $ReadOnly<{\n  useNativeDriver: boolean,\n}>;\n\nconst NativeAnimatedAPI = NativeAnimatedHelper.API;\n\n/**\n * Animated works by building a directed acyclic graph of dependencies\n * transparently when you render your Animated components.\n *\n *               new Animated.Value(0)\n *     .interpolate()        .interpolate()    new Animated.Value(1)\n *         opacity               translateY      scale\n *          style                         transform\n *         View#234                         style\n *                                         View#123\n *\n * A) Top Down phase\n * When an Animated.Value is updated, we recursively go down through this\n * graph in order to find leaf nodes: the views that we flag as needing\n * an update.\n *\n * B) Bottom Up phase\n * When a view is flagged as needing an update, we recursively go back up\n * in order to build the new value that it needs. The reason why we need\n * this two-phases process is to deal with composite props such as\n * transform which can receive values from multiple parents.\n */\nfunction _flush(rootNode: AnimatedValue): void {\n  const animatedStyles = new Set();\n  function findAnimatedStyles(node: AnimatedValue | AnimatedNode) {\n    /* $FlowFixMe[prop-missing] (>=0.68.0 site=react_native_fb) This comment\n     * suppresses an error found when Flow v0.68 was deployed. To see the error\n     * delete this comment and run Flow. */\n    if (typeof node.update === 'function') {\n      animatedStyles.add(node);\n    } else {\n      node.__getChildren().forEach(findAnimatedStyles);\n    }\n  }\n  findAnimatedStyles(rootNode);\n  // $FlowFixMe[prop-missing]\n  animatedStyles.forEach(animatedStyle => animatedStyle.update());\n}\n\n/**\n * Some operations are executed only on batch end, which is _mostly_ scheduled when\n * Animated component props change. For some of the changes which require immediate execution\n * (e.g. setValue), we create a separate batch in case none is scheduled.\n */\nfunction _executeAsAnimatedBatch(id: string, operation: () => void) {\n  NativeAnimatedAPI.setWaitingForIdentifier(id);\n  operation();\n  NativeAnimatedAPI.unsetWaitingForIdentifier(id);\n}\n\n/**\n * Standard value for driving animations.  One `Animated.Value` can drive\n * multiple properties in a synchronized fashion, but can only be driven by one\n * mechanism at a time.  Using a new mechanism (e.g. starting a new animation,\n * or calling `setValue`) will stop any previous ones.\n *\n * See https://reactnative.dev/docs/animatedvalue\n */\nclass AnimatedValue extends AnimatedWithChildren {\n  _value: number;\n  _startingValue: number;\n  _offset: number;\n  _animation: ?Animation;\n  _tracking: ?AnimatedTracking;\n\n  constructor(value: number, config?: ?AnimatedValueConfig) {\n    super();\n    if (typeof value !== 'number') {\n      throw new Error('AnimatedValue: Attempting to set value to undefined');\n    }\n    this._startingValue = this._value = value;\n    this._offset = 0;\n    this._animation = null;\n    if (config && config.useNativeDriver) {\n      this.__makeNative();\n    }\n  }\n\n  __detach() {\n    if (this.__isNative) {\n      NativeAnimatedAPI.getValue(this.__getNativeTag(), value => {\n        this._value = value - this._offset;\n      });\n    }\n    this.stopAnimation();\n    super.__detach();\n  }\n\n  __getValue(): number {\n    return this._value + this._offset;\n  }\n\n  /**\n   * Directly set the value.  This will stop any animations running on the value\n   * and update all the bound properties.\n   *\n   * See https://reactnative.dev/docs/animatedvalue#setvalue\n   */\n  setValue(value: number): void {\n    if (this._animation) {\n      this._animation.stop();\n      this._animation = null;\n    }\n    this._updateValue(\n      value,\n      !this.__isNative /* don't perform a flush for natively driven values */,\n    );\n    if (this.__isNative) {\n      _executeAsAnimatedBatch(this.__getNativeTag().toString(), () =>\n        NativeAnimatedAPI.setAnimatedNodeValue(this.__getNativeTag(), value),\n      );\n    }\n  }\n\n  /**\n   * Sets an offset that is applied on top of whatever value is set, whether via\n   * `setValue`, an animation, or `Animated.event`.  Useful for compensating\n   * things like the start of a pan gesture.\n   *\n   * See https://reactnative.dev/docs/animatedvalue#setoffset\n   */\n  setOffset(offset: number): void {\n    this._offset = offset;\n    if (this.__isNative) {\n      NativeAnimatedAPI.setAnimatedNodeOffset(this.__getNativeTag(), offset);\n    }\n  }\n\n  /**\n   * Merges the offset value into the base value and resets the offset to zero.\n   * The final output of the value is unchanged.\n   *\n   * See https://reactnative.dev/docs/animatedvalue#flattenoffset\n   */\n  flattenOffset(): void {\n    this._value += this._offset;\n    this._offset = 0;\n    if (this.__isNative) {\n      NativeAnimatedAPI.flattenAnimatedNodeOffset(this.__getNativeTag());\n    }\n  }\n\n  /**\n   * Sets the offset value to the base value, and resets the base value to zero.\n   * The final output of the value is unchanged.\n   *\n   * See https://reactnative.dev/docs/animatedvalue#extractoffset\n   */\n  extractOffset(): void {\n    this._offset += this._value;\n    this._value = 0;\n    if (this.__isNative) {\n      NativeAnimatedAPI.extractAnimatedNodeOffset(this.__getNativeTag());\n    }\n  }\n\n  /**\n   * Stops any running animation or tracking. `callback` is invoked with the\n   * final value after stopping the animation, which is useful for updating\n   * state to match the animation position with layout.\n   *\n   * See https://reactnative.dev/docs/animatedvalue#stopanimation\n   */\n  stopAnimation(callback?: ?(value: number) => void): void {\n    this.stopTracking();\n    this._animation && this._animation.stop();\n    this._animation = null;\n    if (callback) {\n      if (this.__isNative) {\n        NativeAnimatedAPI.getValue(this.__getNativeTag(), callback);\n      } else {\n        callback(this.__getValue());\n      }\n    }\n  }\n\n  /**\n   * Stops any animation and resets the value to its original.\n   *\n   * See https://reactnative.dev/docs/animatedvalue#resetanimation\n   */\n  resetAnimation(callback?: ?(value: number) => void): void {\n    this.stopAnimation(callback);\n    this._value = this._startingValue;\n    if (this.__isNative) {\n      NativeAnimatedAPI.setAnimatedNodeValue(\n        this.__getNativeTag(),\n        this._startingValue,\n      );\n    }\n  }\n\n  __onAnimatedValueUpdateReceived(value: number): void {\n    this._updateValue(value, false /*flush*/);\n  }\n\n  /**\n   * Interpolates the value before updating the property, e.g. mapping 0-1 to\n   * 0-10.\n   */\n  interpolate<OutputT: number | string>(\n    config: InterpolationConfigType<OutputT>,\n  ): AnimatedInterpolation<OutputT> {\n    return new AnimatedInterpolation(this, config);\n  }\n\n  /**\n   * Typically only used internally, but could be used by a custom Animation\n   * class.\n   *\n   * See https://reactnative.dev/docs/animatedvalue#animate\n   */\n  animate(animation: Animation, callback: ?EndCallback): void {\n    let handle = null;\n    if (animation.__isInteraction) {\n      handle = InteractionManager.createInteractionHandle();\n    }\n    const previousAnimation = this._animation;\n    this._animation && this._animation.stop();\n    this._animation = animation;\n    animation.start(\n      this._value,\n      value => {\n        // Natively driven animations will never call into that callback\n        this._updateValue(value, true /* flush */);\n      },\n      result => {\n        this._animation = null;\n        if (handle !== null) {\n          InteractionManager.clearInteractionHandle(handle);\n        }\n        callback && callback(result);\n      },\n      previousAnimation,\n      this,\n    );\n  }\n\n  /**\n   * Typically only used internally.\n   */\n  stopTracking(): void {\n    this._tracking && this._tracking.__detach();\n    this._tracking = null;\n  }\n\n  /**\n   * Typically only used internally.\n   */\n  track(tracking: AnimatedTracking): void {\n    this.stopTracking();\n    this._tracking = tracking;\n    // Make sure that the tracking animation starts executing\n    this._tracking && this._tracking.update();\n  }\n\n  _updateValue(value: number, flush: boolean): void {\n    if (value === undefined) {\n      throw new Error('AnimatedValue: Attempting to set value to undefined');\n    }\n\n    this._value = value;\n    if (flush) {\n      _flush(this);\n    }\n    super.__callListeners(this.__getValue());\n  }\n\n  __getNativeConfig(): Object {\n    return {\n      type: 'value',\n      value: this._value,\n      offset: this._offset,\n    };\n  }\n}\n\nexport default AnimatedValue;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/nodes/AnimatedValueXY.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport AnimatedValue from './AnimatedValue';\nimport AnimatedWithChildren from './AnimatedWithChildren';\n\nimport invariant from 'fbjs/lib/invariant';\n\ntype ValueXYListenerCallback = (value: {\n  x: number,\n  y: number,\n  ...\n}) => mixed;\n\nlet _uniqueId = 1;\n\n/**\n * 2D Value for driving 2D animations, such as pan gestures. Almost identical\n * API to normal `Animated.Value`, but multiplexed.\n *\n * See https://reactnative.dev/docs/animatedvaluexy.html\n */\nclass AnimatedValueXY extends AnimatedWithChildren {\n  x: AnimatedValue;\n  y: AnimatedValue;\n  _listeners: {\n    [key: string]: {\n      x: string,\n      y: string,\n      ...\n    },\n    ...,\n  };\n\n  constructor(\n    valueIn?: ?{\n      +x: number | AnimatedValue,\n      +y: number | AnimatedValue,\n      ...\n    },\n  ) {\n    super();\n    const value: any = valueIn || {x: 0, y: 0}; // @flowfixme: shouldn't need `: any`\n    if (typeof value.x === 'number' && typeof value.y === 'number') {\n      this.x = new AnimatedValue(value.x);\n      this.y = new AnimatedValue(value.y);\n    } else {\n      invariant(\n        value.x instanceof AnimatedValue && value.y instanceof AnimatedValue,\n        'AnimatedValueXY must be initialized with an object of numbers or ' +\n          'AnimatedValues.',\n      );\n      this.x = value.x;\n      this.y = value.y;\n    }\n    this._listeners = {};\n  }\n\n  /**\n   * Directly set the value. This will stop any animations running on the value\n   * and update all the bound properties.\n   *\n   * See https://reactnative.dev/docs/animatedvaluexy.html#setvalue\n   */\n  setValue(value: {x: number, y: number, ...}) {\n    this.x.setValue(value.x);\n    this.y.setValue(value.y);\n  }\n\n  /**\n   * Sets an offset that is applied on top of whatever value is set, whether\n   * via `setValue`, an animation, or `Animated.event`. Useful for compensating\n   * things like the start of a pan gesture.\n   *\n   * See https://reactnative.dev/docs/animatedvaluexy.html#setoffset\n   */\n  setOffset(offset: {x: number, y: number, ...}) {\n    this.x.setOffset(offset.x);\n    this.y.setOffset(offset.y);\n  }\n\n  /**\n   * Merges the offset value into the base value and resets the offset to zero.\n   * The final output of the value is unchanged.\n   *\n   * See https://reactnative.dev/docs/animatedvaluexy.html#flattenoffset\n   */\n  flattenOffset(): void {\n    this.x.flattenOffset();\n    this.y.flattenOffset();\n  }\n\n  /**\n   * Sets the offset value to the base value, and resets the base value to\n   * zero. The final output of the value is unchanged.\n   *\n   * See https://reactnative.dev/docs/animatedvaluexy.html#extractoffset\n   */\n  extractOffset(): void {\n    this.x.extractOffset();\n    this.y.extractOffset();\n  }\n\n  __getValue(): {\n    x: number,\n    y: number,\n    ...\n  } {\n    return {\n      x: this.x.__getValue(),\n      y: this.y.__getValue(),\n    };\n  }\n\n  /**\n   * Stops any animation and resets the value to its original.\n   *\n   * See https://reactnative.dev/docs/animatedvaluexy.html#resetanimation\n   */\n  resetAnimation(\n    callback?: (value: {\n      x: number,\n      y: number,\n      ...\n    }) => void,\n  ): void {\n    this.x.resetAnimation();\n    this.y.resetAnimation();\n    callback && callback(this.__getValue());\n  }\n\n  /**\n   * Stops any running animation or tracking. `callback` is invoked with the\n   * final value after stopping the animation, which is useful for updating\n   * state to match the animation position with layout.\n   *\n   * See https://reactnative.dev/docs/animatedvaluexy.html#stopanimation\n   */\n  stopAnimation(\n    callback?: (value: {\n      x: number,\n      y: number,\n      ...\n    }) => void,\n  ): void {\n    this.x.stopAnimation();\n    this.y.stopAnimation();\n    callback && callback(this.__getValue());\n  }\n\n  /**\n   * Adds an asynchronous listener to the value so you can observe updates from\n   * animations.  This is useful because there is no way to synchronously read\n   * the value because it might be driven natively.\n   *\n   * Returns a string that serves as an identifier for the listener.\n   *\n   * See https://reactnative.dev/docs/animatedvaluexy.html#addlistener\n   */\n  addListener(callback: ValueXYListenerCallback): string {\n    const id = String(_uniqueId++);\n    const jointCallback = ({value: number}) => {\n      callback(this.__getValue());\n    };\n    this._listeners[id] = {\n      x: this.x.addListener(jointCallback),\n      y: this.y.addListener(jointCallback),\n    };\n    return id;\n  }\n\n  /**\n   * Unregister a listener. The `id` param shall match the identifier\n   * previously returned by `addListener()`.\n   *\n   * See https://reactnative.dev/docs/animatedvaluexy.html#removelistener\n   */\n  removeListener(id: string): void {\n    this.x.removeListener(this._listeners[id].x);\n    this.y.removeListener(this._listeners[id].y);\n    delete this._listeners[id];\n  }\n\n  /**\n   * Remove all registered listeners.\n   *\n   * See https://reactnative.dev/docs/animatedvaluexy.html#removealllisteners\n   */\n  removeAllListeners(): void {\n    this.x.removeAllListeners();\n    this.y.removeAllListeners();\n    this._listeners = {};\n  }\n\n  /**\n   * Converts `{x, y}` into `{left, top}` for use in style.\n   *\n   * See https://reactnative.dev/docs/animatedvaluexy.html#getlayout\n   */\n  getLayout(): {[key: string]: AnimatedValue, ...} {\n    return {\n      left: this.x,\n      top: this.y,\n    };\n  }\n\n  /**\n   * Converts `{x, y}` into a useable translation transform.\n   *\n   * See https://reactnative.dev/docs/animatedvaluexy.html#gettranslatetransform\n   */\n  getTranslateTransform(): Array<{[key: string]: AnimatedValue, ...}> {\n    return [{translateX: this.x}, {translateY: this.y}];\n  }\n}\n\nexport default AnimatedValueXY;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/nodes/AnimatedWithChildren.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\n'use strict';\n\nimport type {PlatformConfig} from '../AnimatedPlatformConfig';\n\nimport AnimatedNode from './AnimatedNode';\nimport NativeAnimatedHelper from '../NativeAnimatedHelper';\n\nclass AnimatedWithChildren extends AnimatedNode {\n  _children: Array<AnimatedNode>;\n\n  constructor() {\n    super();\n    this._children = [];\n  }\n\n  __makeNative(platformConfig: ?PlatformConfig) {\n    if (!this.__isNative) {\n      this.__isNative = true;\n      for (const child of this._children) {\n        child.__makeNative(platformConfig);\n        NativeAnimatedHelper.API.connectAnimatedNodes(\n          this.__getNativeTag(),\n          child.__getNativeTag(),\n        );\n      }\n    }\n    super.__makeNative(platformConfig);\n  }\n\n  __addChild(child: AnimatedNode): void {\n    if (this._children.length === 0) {\n      this.__attach();\n    }\n    this._children.push(child);\n    if (this.__isNative) {\n      // Only accept \"native\" animated nodes as children\n      child.__makeNative(this.__getPlatformConfig());\n      NativeAnimatedHelper.API.connectAnimatedNodes(\n        this.__getNativeTag(),\n        child.__getNativeTag(),\n      );\n    }\n  }\n\n  __removeChild(child: AnimatedNode): void {\n    const index = this._children.indexOf(child);\n    if (index === -1) {\n      console.warn(\"Trying to remove a child that doesn't exist\");\n      return;\n    }\n    if (this.__isNative && child.__isNative) {\n      NativeAnimatedHelper.API.disconnectAnimatedNodes(\n        this.__getNativeTag(),\n        child.__getNativeTag(),\n      );\n    }\n    this._children.splice(index, 1);\n    if (this._children.length === 0) {\n      this.__detach();\n    }\n  }\n\n  __getChildren(): Array<AnimatedNode> {\n    return this._children;\n  }\n\n  __callListeners(value: number): void {\n    super.__callListeners(value);\n    if (!this.__isNative) {\n      for (const child of this._children) {\n        // $FlowFixMe[method-unbinding] added when improving typing for this parameters\n        if (child.__getValue) {\n          child.__callListeners(child.__getValue());\n        }\n      }\n    }\n  }\n}\n\nexport default AnimatedWithChildren;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Animated/useAnimatedProps.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\n'use strict';\n\nimport AnimatedProps from './nodes/AnimatedProps';\nimport {AnimatedEvent} from './AnimatedEvent';\nimport useRefEffect from '../Utilities/useRefEffect';\nimport NativeAnimatedHelper from './NativeAnimatedHelper';\nimport {\n  useCallback,\n  useEffect,\n  useMemo,\n  useReducer,\n  useRef,\n} from 'react';\n\nimport useLayoutEffect from '../../../modules/useLayoutEffect';\n\ntype ReducedProps<TProps> = {\n  ...TProps,\n  collapsable: boolean,\n  ...\n};\ntype CallbackRef<T> = T => mixed;\n\nexport default function useAnimatedProps<TProps: {...}, TInstance>(\n  props: TProps,\n): [ReducedProps<TProps>, CallbackRef<TInstance | null>] {\n  const [, scheduleUpdate] = useReducer(count => count + 1, 0);\n  const onUpdateRef = useRef<?() => void>(null);\n\n  // TODO: Only invalidate `node` if animated props or `style` change. In the\n  // previous implementation, we permitted `style` to override props with the\n  // same name property name as styles, so we can probably continue doing that.\n  // The ordering of other props *should* not matter.\n  const node = useMemo(\n    () => new AnimatedProps(props, () => onUpdateRef.current?.()),\n    [props],\n  );\n  useAnimatedPropsLifecycle(node);\n\n  // TODO: This \"effect\" does three things:\n  //\n  //   1) Call `setNativeView`.\n  //   2) Update `onUpdateRef`.\n  //   3) Update listeners for `AnimatedEvent` props.\n  //\n  // Ideally, each of these would be separat \"effects\" so that they are not\n  // unnecessarily re-run when irrelevant dependencies change. For example, we\n  // should be able to hoist all `AnimatedEvent` props and only do #3 if either\n  // the `AnimatedEvent` props change or `instance` changes.\n  //\n  // But there is no way to transparently compose three separate callback refs,\n  // so we just combine them all into one for now.\n  const refEffect = useCallback(\n    instance => {\n      // NOTE: This may be called more often than necessary (e.g. when `props`\n      // changes), but `setNativeView` already optimizes for that.\n      node.setNativeView(instance);\n\n      // NOTE: This callback is only used by the JavaScript animation driver.\n      onUpdateRef.current = () => {\n        // Schedule an update for this component to update `reducedProps`,\n        // but do not compute it immediately. If a parent also updated, we\n        // need to merge those new props in before updating.\n        scheduleUpdate();\n      };\n\n      const target = getEventTarget(instance);\n      const events = [];\n\n      for (const propName in props) {\n        const propValue = props[propName];\n        if (propValue instanceof AnimatedEvent && propValue.__isNative) {\n          propValue.__attach(target, propName);\n          events.push([propName, propValue]);\n        }\n      }\n\n      return () => {\n        onUpdateRef.current = null;\n\n        for (const [propName, propValue] of events) {\n          propValue.__detach(target, propName);\n        }\n      };\n    },\n    [props, node],\n  );\n  const callbackRef = useRefEffect<TInstance>(refEffect);\n\n  return [reduceAnimatedProps<TProps>(node), callbackRef];\n}\n\nfunction reduceAnimatedProps<TProps>(\n  node: AnimatedProps,\n): ReducedProps<TProps> {\n  // Force `collapsable` to be false so that the native view is not flattened.\n  // Flattened views cannot be accurately referenced by the native driver.\n  return {\n    ...node.__getValue(),\n    collapsable: false,\n  };\n}\n\n/**\n * Manages the lifecycle of the supplied `AnimatedProps` by invoking `__attach`\n * and `__detach`. However, this is more complicated because `AnimatedProps`\n * uses reference counting to determine when to recursively detach its children\n * nodes. So in order to optimize this, we avoid detaching until the next attach\n * unless we are unmounting.\n */\nfunction useAnimatedPropsLifecycle(node: AnimatedProps): void {\n  const prevNodeRef = useRef<?AnimatedProps>(null);\n  const isUnmountingRef = useRef<boolean>(false);\n\n  useEffect(() => {\n    // It is ok for multiple components to call `flushQueue` because it noops\n    // if the queue is empty. When multiple animated components are mounted at\n    // the same time. Only first component flushes the queue and the others will noop.\n    NativeAnimatedHelper.API.flushQueue();\n  });\n\n  useLayoutEffect(() => {\n    isUnmountingRef.current = false;\n    return () => {\n      isUnmountingRef.current = true;\n    };\n  }, []);\n\n  useLayoutEffect(() => {\n    node.__attach();\n    if (prevNodeRef.current != null) {\n      const prevNode = prevNodeRef.current;\n      // TODO: Stop restoring default values (unless `reset` is called).\n      prevNode.__restoreDefaultValues();\n      prevNode.__detach();\n      prevNodeRef.current = null;\n    }\n    return () => {\n      if (isUnmountingRef.current) {\n        // NOTE: Do not restore default values on unmount, see D18197735.\n        node.__detach();\n      } else {\n        prevNodeRef.current = node;\n      }\n    };\n  }, [node]);\n}\n\nfunction getEventTarget<TInstance>(instance: TInstance): TInstance {\n  return typeof instance === 'object' &&\n    typeof instance?.getScrollableNode === 'function'\n    ? // $FlowFixMe[incompatible-use] - Legacy instance assumptions.\n      instance.getScrollableNode()\n    : instance;\n}\n\n// $FlowFixMe[unclear-type] - Legacy instance assumptions.\nfunction isFabricInstance(instance: any): boolean {\n  return (\n    hasFabricHandle(instance) ||\n    // Some components have a setNativeProps function but aren't a host component\n    // such as lists like FlatList and SectionList. These should also use\n    // forceUpdate in Fabric since setNativeProps doesn't exist on the underlying\n    // host component. This crazy hack is essentially special casing those lists and\n    // ScrollView itself to use forceUpdate in Fabric.\n    // If these components end up using forwardRef then these hacks can go away\n    // as instance would actually be the underlying host component and the above check\n    // would be sufficient.\n    hasFabricHandle(instance?.getNativeScrollRef?.()) ||\n    hasFabricHandle(instance?.getScrollResponder?.()?.getNativeScrollRef?.())\n  );\n}\n\n// $FlowFixMe[unclear-type] - Legacy instance assumptions.\nfunction hasFabricHandle(instance: any): boolean {\n  // eslint-disable-next-line dot-notation\n  return instance?.['_internalInstanceHandle']?.stateNode?.canonical != null;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Batchinator/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * @flow strict-local\n */\n\n'use strict';\n\nimport InteractionManager from '../../../exports/InteractionManager';\n\n/**\n * A simple class for batching up invocations of a low-pri callback. A timeout is set to run the\n * callback once after a delay, no matter how many times it's scheduled. Once the delay is reached,\n * InteractionManager.runAfterInteractions is used to invoke the callback after any hi-pri\n * interactions are done running.\n *\n * Make sure to cleanup with dispose().  Example:\n *\n *   class Widget extends React.Component {\n *     _batchedSave: new Batchinator(() => this._saveState, 1000);\n *     _saveSate() {\n *       // save this.state to disk\n *     }\n *     componentDidUpdate() {\n *       this._batchedSave.schedule();\n *     }\n *     componentWillUnmount() {\n *       this._batchedSave.dispose();\n *     }\n *     ...\n *   }\n */\nclass Batchinator {\n  _callback: () => void;\n  _delay: number;\n  _taskHandle: ?{cancel: () => void, ...};\n  constructor(callback: () => void, delayMS: number) {\n    this._delay = delayMS;\n    this._callback = callback;\n  }\n  /*\n   * Cleanup any pending tasks.\n   *\n   * By default, if there is a pending task the callback is run immediately. Set the option abort to\n   * true to not call the callback if it was pending.\n   */\n  dispose(options: {abort: boolean, ...} = {abort: false}) {\n    if (this._taskHandle) {\n      this._taskHandle.cancel();\n      if (!options.abort) {\n        this._callback();\n      }\n      this._taskHandle = null;\n    }\n  }\n  schedule() {\n    if (this._taskHandle) {\n      return;\n    }\n    const timeoutHandle = setTimeout(() => {\n      this._taskHandle = InteractionManager.runAfterInteractions(() => {\n        // Note that we clear the handle before invoking the callback so that if the callback calls\n        // schedule again, it will actually schedule another task.\n        this._taskHandle = null;\n        this._callback();\n      });\n    }, this._delay);\n    this._taskHandle = {cancel: () => clearTimeout(timeoutHandle)};\n  }\n}\n\nexport default Batchinator;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/EventEmitter/NativeEventEmitter.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\n'use strict';\n\nimport {\n  type EventSubscription,\n  type IEventEmitter,\n} from '../vendor/emitter/EventEmitter';\nimport Platform from '../../../exports/Platform';\nimport RCTDeviceEventEmitter from './RCTDeviceEventEmitter';\nimport invariant from 'fbjs/lib/invariant';\n\ntype NativeModule = $ReadOnly<{\n  addListener: (eventType: string) => void,\n  removeListeners: (count: number) => void,\n  ...\n}>;\n\nexport type {EventSubscription};\n\n/**\n * `NativeEventEmitter` is intended for use by Native Modules to emit events to\n * JavaScript listeners. If a `NativeModule` is supplied to the constructor, it\n * will be notified (via `addListener` and `removeListeners`) when the listener\n * count changes to manage \"native memory\".\n *\n * Currently, all native events are fired via a global `RCTDeviceEventEmitter`.\n * This means event names must be globally unique, and it means that call sites\n * can theoretically listen to `RCTDeviceEventEmitter` (although discouraged).\n */\nexport default class NativeEventEmitter<TEventToArgsMap: {...}>\n  implements IEventEmitter<TEventToArgsMap> {\n  _nativeModule: ?NativeModule;\n\n  constructor(nativeModule: ?NativeModule) {\n    if (Platform.OS === 'ios') {\n      invariant(\n        nativeModule != null,\n        '`new NativeEventEmitter()` requires a non-null argument.',\n      );\n      this._nativeModule = nativeModule;\n    }\n  }\n\n  addListener<TEvent: $Keys<TEventToArgsMap>>(\n    eventType: TEvent,\n    listener: (...args: $ElementType<TEventToArgsMap, TEvent>) => mixed,\n    context?: mixed,\n  ): EventSubscription {\n    this._nativeModule?.addListener(eventType);\n    let subscription: ?EventSubscription = RCTDeviceEventEmitter.addListener(\n      eventType,\n      listener,\n      context,\n    );\n\n    return {\n      remove: () => {\n        if (subscription != null) {\n          this._nativeModule?.removeListeners(1);\n          // $FlowFixMe[incompatible-use]\n          subscription.remove();\n          subscription = null;\n        }\n      },\n    };\n  }\n\n  /**\n   * @deprecated Use `remove` on the EventSubscription from `addListener`.\n   */\n  removeListener<TEvent: $Keys<TEventToArgsMap>>(\n    eventType: TEvent,\n    listener: (...args: $ElementType<TEventToArgsMap, TEvent>) => mixed,\n  ): void {\n    this._nativeModule?.removeListeners(1);\n    // NOTE: This will report a deprecation notice via `console.error`.\n    // $FlowFixMe[prop-missing] - `removeListener` exists but is deprecated.\n    RCTDeviceEventEmitter.removeListener(eventType, listener);\n  }\n\n  emit<TEvent: $Keys<TEventToArgsMap>>(\n    eventType: TEvent,\n    ...args: $ElementType<TEventToArgsMap, TEvent>\n  ): void {\n    // Generally, `RCTDeviceEventEmitter` is directly invoked. But this is\n    // included for completeness.\n    RCTDeviceEventEmitter.emit(eventType, ...args);\n  }\n\n  removeAllListeners<TEvent: $Keys<TEventToArgsMap>>(\n    eventType?: ?TEvent,\n  ): void {\n    invariant(\n      eventType != null,\n      '`NativeEventEmitter.removeAllListener()` requires a non-null argument.',\n    );\n    this._nativeModule?.removeListeners(this.listenerCount(eventType));\n    RCTDeviceEventEmitter.removeAllListeners(eventType);\n  }\n\n  listenerCount<TEvent: $Keys<TEventToArgsMap>>(eventType: TEvent): number {\n    return RCTDeviceEventEmitter.listenerCount(eventType);\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/EventEmitter/RCTDeviceEventEmitter.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict\n * @format\n */\n\nimport EventEmitter, {type IEventEmitter} from '../vendor/emitter/EventEmitter';\n\n// FIXME: use typed events\ntype RCTDeviceEventDefinitions = $FlowFixMe;\n\n/**\n * Global EventEmitter used by the native platform to emit events to JavaScript.\n * Events are identified by globally unique event names.\n *\n * NativeModules that emit events should instead subclass `NativeEventEmitter`.\n */\nexport default (new EventEmitter(): IEventEmitter<RCTDeviceEventDefinitions>);\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/FillRateHelper/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport type {FrameMetricProps} from '../VirtualizedList/VirtualizedListProps';\n\nexport type FillRateInfo = Info;\n\nclass Info {\n  any_blank_count: number = 0;\n  any_blank_ms: number = 0;\n  any_blank_speed_sum: number = 0;\n  mostly_blank_count: number = 0;\n  mostly_blank_ms: number = 0;\n  pixels_blank: number = 0;\n  pixels_sampled: number = 0;\n  pixels_scrolled: number = 0;\n  total_time_spent: number = 0;\n  sample_count: number = 0;\n}\n\ntype FrameMetrics = {\n  inLayout?: boolean,\n  length: number,\n  offset: number,\n  ...\n};\n\nconst DEBUG = false;\n\nlet _listeners: Array<(Info) => void> = [];\nlet _minSampleCount = 10;\nlet _sampleRate = DEBUG ? 1 : null;\n\n/**\n * A helper class for detecting when the maximem fill rate of `VirtualizedList` is exceeded.\n * By default the sampling rate is set to zero and this will do nothing. If you want to collect\n * samples (e.g. to log them), make sure to call `FillRateHelper.setSampleRate(0.0-1.0)`.\n *\n * Listeners and sample rate are global for all `VirtualizedList`s - typical usage will combine with\n * `SceneTracker.getActiveScene` to determine the context of the events.\n */\nclass FillRateHelper {\n  _anyBlankStartTime: ?number = null;\n  _enabled = false;\n  _getFrameMetrics: (index: number, props: FrameMetricProps) => ?FrameMetrics;\n  _info: Info = new Info();\n  _mostlyBlankStartTime: ?number = null;\n  _samplesStartTime: ?number = null;\n\n  static addListener(callback: FillRateInfo => void): {\n    remove: () => void,\n    ...\n  } {\n    if (_sampleRate === null) {\n      console.warn('Call `FillRateHelper.setSampleRate` before `addListener`.');\n    }\n    _listeners.push(callback);\n    return {\n      remove: () => {\n        _listeners = _listeners.filter(listener => callback !== listener);\n      },\n    };\n  }\n\n  static setSampleRate(sampleRate: number) {\n    _sampleRate = sampleRate;\n  }\n\n  static setMinSampleCount(minSampleCount: number) {\n    _minSampleCount = minSampleCount;\n  }\n\n  constructor(\n    getFrameMetrics: (index: number, props: FrameMetricProps) => ?FrameMetrics,\n  ) {\n    this._getFrameMetrics = getFrameMetrics;\n    this._enabled = (_sampleRate || 0) > Math.random();\n    this._resetData();\n  }\n\n  activate() {\n    if (this._enabled && this._samplesStartTime == null) {\n      DEBUG && console.debug('FillRateHelper: activate');\n      this._samplesStartTime = global.performance.now();\n    }\n  }\n\n  deactivateAndFlush() {\n    if (!this._enabled) {\n      return;\n    }\n    const start = this._samplesStartTime; // const for flow\n    if (start == null) {\n      DEBUG &&\n        console.debug('FillRateHelper: bail on deactivate with no start time');\n      return;\n    }\n    if (this._info.sample_count < _minSampleCount) {\n      // Don't bother with under-sampled events.\n      this._resetData();\n      return;\n    }\n    const total_time_spent = global.performance.now() - start;\n    const info: any = {\n      ...this._info,\n      total_time_spent,\n    };\n    if (DEBUG) {\n      const derived = {\n        avg_blankness: this._info.pixels_blank / this._info.pixels_sampled,\n        avg_speed: this._info.pixels_scrolled / (total_time_spent / 1000),\n        avg_speed_when_any_blank:\n          this._info.any_blank_speed_sum / this._info.any_blank_count,\n        any_blank_per_min:\n          this._info.any_blank_count / (total_time_spent / 1000 / 60),\n        any_blank_time_frac: this._info.any_blank_ms / total_time_spent,\n        mostly_blank_per_min:\n          this._info.mostly_blank_count / (total_time_spent / 1000 / 60),\n        mostly_blank_time_frac: this._info.mostly_blank_ms / total_time_spent,\n      };\n      for (const key in derived) {\n        // $FlowFixMe[prop-missing]\n        derived[key] = Math.round(1000 * derived[key]) / 1000;\n      }\n      console.debug('FillRateHelper deactivateAndFlush: ', {derived, info});\n    }\n    _listeners.forEach(listener => listener(info));\n    this._resetData();\n  }\n\n  computeBlankness(\n    props: {\n      ...FrameMetricProps,\n      initialNumToRender?: ?number,\n      ...\n    },\n    cellsAroundViewport: {\n      first: number,\n      last: number,\n      ...\n    },\n    scrollMetrics: {\n      dOffset: number,\n      offset: number,\n      velocity: number,\n      visibleLength: number,\n      ...\n    },\n  ): number {\n    if (\n      !this._enabled ||\n      props.getItemCount(props.data) === 0 ||\n      cellsAroundViewport.last < cellsAroundViewport.first ||\n      this._samplesStartTime == null\n    ) {\n      return 0;\n    }\n    const {dOffset, offset, velocity, visibleLength} = scrollMetrics;\n\n    // Denominator metrics that we track for all events - most of the time there is no blankness and\n    // we want to capture that.\n    this._info.sample_count++;\n    this._info.pixels_sampled += Math.round(visibleLength);\n    this._info.pixels_scrolled += Math.round(Math.abs(dOffset));\n    const scrollSpeed = Math.round(Math.abs(velocity) * 1000); // px / sec\n\n    // Whether blank now or not, record the elapsed time blank if we were blank last time.\n    const now = global.performance.now();\n    if (this._anyBlankStartTime != null) {\n      this._info.any_blank_ms += now - this._anyBlankStartTime;\n    }\n    this._anyBlankStartTime = null;\n    if (this._mostlyBlankStartTime != null) {\n      this._info.mostly_blank_ms += now - this._mostlyBlankStartTime;\n    }\n    this._mostlyBlankStartTime = null;\n\n    let blankTop = 0;\n    let first = cellsAroundViewport.first;\n    let firstFrame = this._getFrameMetrics(first, props);\n    while (\n      first <= cellsAroundViewport.last &&\n      (!firstFrame || !firstFrame.inLayout)\n    ) {\n      firstFrame = this._getFrameMetrics(first, props);\n      first++;\n    }\n    // Only count blankTop if we aren't rendering the first item, otherwise we will count the header\n    // as blank.\n    if (firstFrame && first > 0) {\n      blankTop = Math.min(\n        visibleLength,\n        Math.max(0, firstFrame.offset - offset),\n      );\n    }\n    let blankBottom = 0;\n    let last = cellsAroundViewport.last;\n    let lastFrame = this._getFrameMetrics(last, props);\n    while (\n      last >= cellsAroundViewport.first &&\n      (!lastFrame || !lastFrame.inLayout)\n    ) {\n      lastFrame = this._getFrameMetrics(last, props);\n      last--;\n    }\n    // Only count blankBottom if we aren't rendering the last item, otherwise we will count the\n    // footer as blank.\n    if (lastFrame && last < props.getItemCount(props.data) - 1) {\n      const bottomEdge = lastFrame.offset + lastFrame.length;\n      blankBottom = Math.min(\n        visibleLength,\n        Math.max(0, offset + visibleLength - bottomEdge),\n      );\n    }\n    const pixels_blank = Math.round(blankTop + blankBottom);\n    const blankness = pixels_blank / visibleLength;\n    if (blankness > 0) {\n      this._anyBlankStartTime = now;\n      this._info.any_blank_speed_sum += scrollSpeed;\n      this._info.any_blank_count++;\n      this._info.pixels_blank += pixels_blank;\n      if (blankness > 0.5) {\n        this._mostlyBlankStartTime = now;\n        this._info.mostly_blank_count++;\n      }\n    } else if (scrollSpeed < 0.01 || Math.abs(dOffset) < 1) {\n      this.deactivateAndFlush();\n    }\n    return blankness;\n  }\n\n  enabled(): boolean {\n    return this._enabled;\n  }\n\n  _resetData() {\n    this._anyBlankStartTime = null;\n    this._info = new Info();\n    this._mostlyBlankStartTime = null;\n    this._samplesStartTime = null;\n  }\n}\n\nexport default FillRateHelper;"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/FlatList/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\nimport View, { type ViewProps } from '../../../exports/View';\nimport StyleSheet from '../../../exports/StyleSheet';\nimport deepDiffer from '../deepDiffer';\nimport Platform from '../../../exports/Platform';\nimport invariant from 'fbjs/lib/invariant';\nimport * as React from 'react';\n\ntype ScrollViewNativeComponent = any;\ntype ViewStyleProp = $PropertyType<ViewProps, 'style'>;\nimport type {\n  ViewToken,\n  ViewabilityConfigCallbackPair,\n} from '../ViewabilityHelper';\nimport type {RenderItemType, RenderItemProps} from '../VirtualizedList';\ntype ScrollResponderType = any;\nimport VirtualizedList from '../VirtualizedList';\nimport {keyExtractor as defaultKeyExtractor} from '../VirtualizeUtils';\n\nimport memoizeOne from 'memoize-one';\n\ntype $FlowFixMe = any;\n\ntype RequiredProps<ItemT> = {|\n  /**\n   * An array (or array-like list) of items to render. Other data types can be\n   * used by targetting VirtualizedList directly.\n   */\n  data: ?$ArrayLike<ItemT>,\n|};\ntype OptionalProps<ItemT> = {|\n  /**\n   * Takes an item from `data` and renders it into the list. Example usage:\n   *\n   *     <FlatList\n   *       ItemSeparatorComponent={Platform.OS !== 'android' && ({highlighted}) => (\n   *         <View style={[style.separator, highlighted && {marginLeft: 0}]} />\n   *       )}\n   *       data={[{title: 'Title Text', key: 'item1'}]}\n   *       renderItem={({item, separators}) => (\n   *         <TouchableHighlight\n   *           onPress={() => this._onPress(item)}\n   *           onShowUnderlay={separators.highlight}\n   *           onHideUnderlay={separators.unhighlight}>\n   *           <View style={{backgroundColor: 'white'}}>\n   *             <Text>{item.title}</Text>\n   *           </View>\n   *         </TouchableHighlight>\n   *       )}\n   *     />\n   *\n   * Provides additional metadata like `index` if you need it, as well as a more generic\n   * `separators.updateProps` function which let's you set whatever props you want to change the\n   * rendering of either the leading separator or trailing separator in case the more common\n   * `highlight` and `unhighlight` (which set the `highlighted: boolean` prop) are insufficient for\n   * your use-case.\n   */\n  renderItem?: ?RenderItemType<ItemT>,\n\n  /**\n   * Optional custom style for multi-item rows generated when numColumns > 1.\n   */\n  columnWrapperStyle?: ViewStyleProp,\n  /**\n   * A marker property for telling the list to re-render (since it implements `PureComponent`). If\n   * any of your `renderItem`, Header, Footer, etc. functions depend on anything outside of the\n   * `data` prop, stick it here and treat it immutably.\n   */\n  extraData?: any,\n  /**\n   * `getItemLayout` is an optional optimizations that let us skip measurement of dynamic content if\n   * you know the height of items a priori. `getItemLayout` is the most efficient, and is easy to\n   * use if you have fixed height items, for example:\n   *\n   *     getItemLayout={(data, index) => (\n   *       {length: ITEM_HEIGHT, offset: ITEM_HEIGHT * index, index}\n   *     )}\n   *\n   * Adding `getItemLayout` can be a great performance boost for lists of several hundred items.\n   * Remember to include separator length (height or width) in your offset calculation if you\n   * specify `ItemSeparatorComponent`.\n   */\n  getItemLayout?: (\n    data: ?$ArrayLike<ItemT>,\n    index: number,\n  ) => {\n    length: number,\n    offset: number,\n    index: number,\n    ...\n  },\n  /**\n   * If true, renders items next to each other horizontally instead of stacked vertically.\n   */\n  horizontal?: ?boolean,\n  /**\n   * How many items to render in the initial batch. This should be enough to fill the screen but not\n   * much more. Note these items will never be unmounted as part of the windowed rendering in order\n   * to improve perceived performance of scroll-to-top actions.\n   */\n  initialNumToRender?: ?number,\n  /**\n   * Instead of starting at the top with the first item, start at `initialScrollIndex`. This\n   * disables the \"scroll to top\" optimization that keeps the first `initialNumToRender` items\n   * always rendered and immediately renders the items starting at this initial index. Requires\n   * `getItemLayout` to be implemented.\n   */\n  initialScrollIndex?: ?number,\n  /**\n   * Reverses the direction of scroll. Uses scale transforms of -1.\n   */\n  inverted?: ?boolean,\n  /**\n   * Used to extract a unique key for a given item at the specified index. Key is used for caching\n   * and as the react key to track item re-ordering. The default extractor checks `item.key`, then\n   * falls back to using the index, like React does.\n   */\n  keyExtractor?: ?(item: ItemT, index: number) => string,\n  /**\n   * Multiple columns can only be rendered with `horizontal={false}` and will zig-zag like a\n   * `flexWrap` layout. Items should all be the same height - masonry layouts are not supported.\n   *\n   * The default value is 1.\n   */\n  numColumns?: number,\n  /**\n   * Note: may have bugs (missing content) in some circumstances - use at your own risk.\n   *\n   * This may improve scroll performance for large lists.\n   *\n   * The default value is true for Android.\n   */\n  removeClippedSubviews?: boolean,\n  /**\n   * See `ScrollView` for flow type and further documentation.\n   */\n  fadingEdgeLength?: ?number,\n  /**\n   * Enable an optimization to memoize the item renderer to prevent unnecessary rerenders.\n   */\n  strictMode?: boolean,\n|};\n\n/**\n * Default Props Helper Functions\n * Use the following helper functions for default values\n */\n\n// removeClippedSubviewsOrDefault(this.props.removeClippedSubviews)\nfunction removeClippedSubviewsOrDefault(removeClippedSubviews: ?boolean) {\n  return removeClippedSubviews ?? Platform.OS === 'android';\n}\n\n// numColumnsOrDefault(this.props.numColumns)\nfunction numColumnsOrDefault(numColumns: ?number) {\n  return numColumns ?? 1;\n}\n\nfunction isArrayLike(data: mixed): boolean {\n  // $FlowExpectedError[incompatible-use]\n  return typeof Object(data).length === 'number';\n}\n\ntype FlatListProps<ItemT> = {|\n  ...RequiredProps<ItemT>,\n  ...OptionalProps<ItemT>,\n|};\n\ntype VirtualizedListProps = React.ElementConfig<typeof VirtualizedList>;\n\nexport type Props<ItemT> = {\n  ...$Diff<\n    VirtualizedListProps,\n    {\n      getItem: $PropertyType<VirtualizedListProps, 'getItem'>,\n      getItemCount: $PropertyType<VirtualizedListProps, 'getItemCount'>,\n      getItemLayout: $PropertyType<VirtualizedListProps, 'getItemLayout'>,\n      renderItem: $PropertyType<VirtualizedListProps, 'renderItem'>,\n      keyExtractor: $PropertyType<VirtualizedListProps, 'keyExtractor'>,\n      ...\n    },\n  >,\n  ...FlatListProps<ItemT>,\n  ...\n};\n\n/**\n * A performant interface for rendering simple, flat lists, supporting the most handy features:\n *\n *  - Fully cross-platform.\n *  - Optional horizontal mode.\n *  - Configurable viewability callbacks.\n *  - Header support.\n *  - Footer support.\n *  - Separator support.\n *  - Pull to Refresh.\n *  - Scroll loading.\n *  - ScrollToIndex support.\n *\n * If you need section support, use [`<SectionList>`](docs/sectionlist.html).\n *\n * Minimal Example:\n *\n *     <FlatList\n *       data={[{key: 'a'}, {key: 'b'}]}\n *       renderItem={({item}) => <Text>{item.key}</Text>}\n *     />\n *\n * More complex, multi-select example demonstrating `PureComponent` usage for perf optimization and avoiding bugs.\n *\n * - By binding the `onPressItem` handler, the props will remain `===` and `PureComponent` will\n *   prevent wasteful re-renders unless the actual `id`, `selected`, or `title` props change, even\n *   if the components rendered in `MyListItem` did not have such optimizations.\n * - By passing `extraData={this.state}` to `FlatList` we make sure `FlatList` itself will re-render\n *   when the `state.selected` changes. Without setting this prop, `FlatList` would not know it\n *   needs to re-render any items because it is also a `PureComponent` and the prop comparison will\n *   not show any changes.\n * - `keyExtractor` tells the list to use the `id`s for the react keys instead of the default `key` property.\n *\n *\n *     class MyListItem extends React.PureComponent {\n *       _onPress = () => {\n *         this.props.onPressItem(this.props.id);\n *       };\n *\n *       render() {\n *         const textColor = this.props.selected ? \"red\" : \"black\";\n *         return (\n *           <TouchableOpacity onPress={this._onPress}>\n *             <View>\n *               <Text style={{ color: textColor }}>\n *                 {this.props.title}\n *               </Text>\n *             </View>\n *           </TouchableOpacity>\n *         );\n *       }\n *     }\n *\n *     class MultiSelectList extends React.PureComponent {\n *       state = {selected: (new Map(): Map<string, boolean>)};\n *\n *       _keyExtractor = (item, index) => item.id;\n *\n *       _onPressItem = (id: string) => {\n *         // updater functions are preferred for transactional updates\n *         this.setState((state) => {\n *           // copy the map rather than modifying state.\n *           const selected = new Map(state.selected);\n *           selected.set(id, !selected.get(id)); // toggle\n *           return {selected};\n *         });\n *       };\n *\n *       _renderItem = ({item}) => (\n *         <MyListItem\n *           id={item.id}\n *           onPressItem={this._onPressItem}\n *           selected={!!this.state.selected.get(item.id)}\n *           title={item.title}\n *         />\n *       );\n *\n *       render() {\n *         return (\n *           <FlatList\n *             data={this.props.data}\n *             extraData={this.state}\n *             keyExtractor={this._keyExtractor}\n *             renderItem={this._renderItem}\n *           />\n *         );\n *       }\n *     }\n *\n * This is a convenience wrapper around [`<VirtualizedList>`](docs/virtualizedlist.html),\n * and thus inherits its props (as well as those of `ScrollView`) that aren't explicitly listed\n * here, along with the following caveats:\n *\n * - Internal state is not preserved when content scrolls out of the render window. Make sure all\n *   your data is captured in the item data or external stores like Flux, Redux, or Relay.\n * - This is a `PureComponent` which means that it will not re-render if `props` remain shallow-\n *   equal. Make sure that everything your `renderItem` function depends on is passed as a prop\n *   (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on\n *   changes. This includes the `data` prop and parent component state.\n * - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously\n *   offscreen. This means it's possible to scroll faster than the fill rate ands momentarily see\n *   blank content. This is a tradeoff that can be adjusted to suit the needs of each application,\n *   and we are working on improving it behind the scenes.\n * - By default, the list looks for a `key` prop on each item and uses that for the React key.\n *   Alternatively, you can provide a custom `keyExtractor` prop.\n *\n * Also inherits [ScrollView Props](docs/scrollview.html#props), unless it is nested in another FlatList of same orientation.\n */\nclass FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {\n  props: Props<ItemT>;\n  /**\n   * Scrolls to the end of the content. May be janky without `getItemLayout` prop.\n   */\n  scrollToEnd(params?: ?{animated?: ?boolean, ...}) {\n    if (this._listRef) {\n      this._listRef.scrollToEnd(params);\n    }\n  }\n\n  /**\n   * Scrolls to the item at the specified index such that it is positioned in the viewable area\n   * such that `viewPosition` 0 places it at the top, 1 at the bottom, and 0.5 centered in the\n   * middle. `viewOffset` is a fixed number of pixels to offset the final target position.\n   *\n   * Note: cannot scroll to locations outside the render window without specifying the\n   * `getItemLayout` prop.\n   */\n  scrollToIndex(params: {\n    animated?: ?boolean,\n    index: number,\n    viewOffset?: number,\n    viewPosition?: number,\n    ...\n  }) {\n    if (this._listRef) {\n      this._listRef.scrollToIndex(params);\n    }\n  }\n\n  /**\n   * Requires linear scan through data - use `scrollToIndex` instead if possible.\n   *\n   * Note: cannot scroll to locations outside the render window without specifying the\n   * `getItemLayout` prop.\n   */\n  scrollToItem(params: {\n    animated?: ?boolean,\n    item: ItemT,\n    viewOffset?: number,\n    viewPosition?: number,\n    ...\n  }) {\n    if (this._listRef) {\n      this._listRef.scrollToItem(params);\n    }\n  }\n\n  /**\n   * Scroll to a specific content pixel offset in the list.\n   *\n   * Check out [scrollToOffset](docs/virtualizedlist.html#scrolltooffset) of VirtualizedList\n   */\n  scrollToOffset(params: {animated?: ?boolean, offset: number, ...}) {\n    if (this._listRef) {\n      this._listRef.scrollToOffset(params);\n    }\n  }\n\n  /**\n   * Tells the list an interaction has occurred, which should trigger viewability calculations, e.g.\n   * if `waitForInteractions` is true and the user has not scrolled. This is typically called by\n   * taps on items or by navigation actions.\n   */\n  recordInteraction() {\n    if (this._listRef) {\n      this._listRef.recordInteraction();\n    }\n  }\n\n  /**\n   * Displays the scroll indicators momentarily.\n   *\n   * @platform ios\n   */\n  flashScrollIndicators() {\n    if (this._listRef) {\n      this._listRef.flashScrollIndicators();\n    }\n  }\n\n  /**\n   * Provides a handle to the underlying scroll responder.\n   */\n  getScrollResponder(): ?ScrollResponderType {\n    if (this._listRef) {\n      return this._listRef.getScrollResponder();\n    }\n  }\n\n  /**\n   * Provides a reference to the underlying host component\n   */\n  getNativeScrollRef():\n    | ?React.ElementRef<typeof View>\n    | ?React.ElementRef<ScrollViewNativeComponent> {\n    if (this._listRef) {\n      /* $FlowFixMe[incompatible-return] Suppresses errors found when fixing\n       * TextInput typing */\n      return this._listRef.getScrollRef();\n    }\n  }\n\n  getScrollableNode(): any {\n    if (this._listRef) {\n      return this._listRef.getScrollableNode();\n    }\n  }\n\n  constructor(props: Props<ItemT>) {\n    super(props);\n    this._checkProps(this.props);\n    if (this.props.viewabilityConfigCallbackPairs) {\n      this._virtualizedListPairs =\n        this.props.viewabilityConfigCallbackPairs.map(pair => ({\n          viewabilityConfig: pair.viewabilityConfig,\n          onViewableItemsChanged: this._createOnViewableItemsChanged(\n            pair.onViewableItemsChanged,\n          ),\n        }));\n    } else if (this.props.onViewableItemsChanged) {\n      this._virtualizedListPairs.push({\n        /* $FlowFixMe[incompatible-call] (>=0.63.0 site=react_native_fb) This\n         * comment suppresses an error found when Flow v0.63 was deployed. To\n         * see the error delete this comment and run Flow. */\n        viewabilityConfig: this.props.viewabilityConfig,\n        onViewableItemsChanged: this._createOnViewableItemsChanged(\n          this.props.onViewableItemsChanged,\n        ),\n      });\n    }\n  }\n\n  // $FlowFixMe[missing-local-annot]\n  componentDidUpdate(prevProps: Props<ItemT>) {\n    invariant(\n      prevProps.numColumns === this.props.numColumns,\n      'Changing numColumns on the fly is not supported. Change the key prop on FlatList when ' +\n        'changing the number of columns to force a fresh render of the component.',\n    );\n    invariant(\n      prevProps.onViewableItemsChanged === this.props.onViewableItemsChanged,\n      'Changing onViewableItemsChanged on the fly is not supported',\n    );\n    invariant(\n      !deepDiffer(prevProps.viewabilityConfig, this.props.viewabilityConfig),\n      'Changing viewabilityConfig on the fly is not supported',\n    );\n    invariant(\n      prevProps.viewabilityConfigCallbackPairs ===\n        this.props.viewabilityConfigCallbackPairs,\n      'Changing viewabilityConfigCallbackPairs on the fly is not supported',\n    );\n\n    this._checkProps(this.props);\n  }\n\n  _listRef: ?React.ElementRef<typeof VirtualizedList>;\n  _virtualizedListPairs: Array<ViewabilityConfigCallbackPair> = [];\n\n  _captureRef = (ref: ?React.ElementRef<typeof VirtualizedList>) => {\n    this._listRef = ref;\n  };\n\n  // $FlowFixMe[missing-local-annot]\n  _checkProps(props: Props<ItemT>) {\n    const {\n      // $FlowFixMe[prop-missing] this prop doesn't exist, is only used for an invariant\n      getItem,\n      // $FlowFixMe[prop-missing] this prop doesn't exist, is only used for an invariant\n      getItemCount,\n      horizontal,\n      columnWrapperStyle,\n      onViewableItemsChanged,\n      viewabilityConfigCallbackPairs,\n    } = props;\n    const numColumns = numColumnsOrDefault(this.props.numColumns);\n    invariant(\n      !getItem && !getItemCount,\n      'FlatList does not support custom data formats.',\n    );\n    if (numColumns > 1) {\n      invariant(!horizontal, 'numColumns does not support horizontal.');\n    } else {\n      invariant(\n        !columnWrapperStyle,\n        'columnWrapperStyle not supported for single column lists',\n      );\n    }\n    invariant(\n      !(onViewableItemsChanged && viewabilityConfigCallbackPairs),\n      'FlatList does not support setting both onViewableItemsChanged and ' +\n        'viewabilityConfigCallbackPairs.',\n    );\n  }\n\n  _getItem = (\n    data: $ArrayLike<ItemT>,\n    index: number,\n  ): ?(ItemT | $ReadOnlyArray<ItemT>) => {\n    const numColumns = numColumnsOrDefault(this.props.numColumns);\n    if (numColumns > 1) {\n      const ret = [];\n      for (let kk = 0; kk < numColumns; kk++) {\n        const itemIndex = index * numColumns + kk;\n        if (itemIndex < data.length) {\n          const item = data[itemIndex];\n          ret.push(item);\n        }\n      }\n      return ret;\n    } else {\n      return data[index];\n    }\n  };\n\n  _getItemCount = (data: ?$ArrayLike<ItemT>): number => {\n    // Legacy behavior of FlatList was to forward \"undefined\" length if invalid\n    // data like a non-arraylike object is passed. VirtualizedList would then\n    // coerce this, and the math would work out to no-op. For compatibility, if\n    // invalid data is passed, we tell VirtualizedList there are zero items\n    // available to prevent it from trying to read from the invalid data\n    // (without propagating invalidly typed data).\n    if (data != null && isArrayLike(data)) {\n      const numColumns = numColumnsOrDefault(this.props.numColumns);\n      return numColumns > 1 ? Math.ceil(data.length / numColumns) : data.length;\n    } else {\n      return 0;\n    }\n  };\n\n  _keyExtractor = (items: ItemT | Array<ItemT>, index: number): string => {\n    const numColumns = numColumnsOrDefault(this.props.numColumns);\n    const keyExtractor = this.props.keyExtractor ?? defaultKeyExtractor;\n\n    if (numColumns > 1) {\n      invariant(\n        Array.isArray(items),\n        'FlatList: Encountered internal consistency error, expected each item to consist of an ' +\n          'array with 1-%s columns; instead, received a single item.',\n        numColumns,\n      );\n      return items\n        .map((item, kk) =>\n          keyExtractor(((item: $FlowFixMe): ItemT), index * numColumns + kk),\n        )\n        .join(':');\n    }\n\n    // $FlowFixMe[incompatible-call] Can't call keyExtractor with an array\n    return keyExtractor(items, index);\n  };\n\n  _pushMultiColumnViewable(arr: Array<ViewToken>, v: ViewToken): void {\n    const numColumns = numColumnsOrDefault(this.props.numColumns);\n    const keyExtractor = this.props.keyExtractor ?? defaultKeyExtractor;\n    v.item.forEach((item, ii) => {\n      invariant(v.index != null, 'Missing index!');\n      const index = v.index * numColumns + ii;\n      arr.push({...v, item, key: keyExtractor(item, index), index});\n    });\n  }\n\n  _createOnViewableItemsChanged(\n    onViewableItemsChanged: ?(info: {\n      viewableItems: Array<ViewToken>,\n      changed: Array<ViewToken>,\n      ...\n    }) => void,\n    // $FlowFixMe[missing-local-annot]\n  ) {\n    return (info: {\n      viewableItems: Array<ViewToken>,\n      changed: Array<ViewToken>,\n      ...\n    }) => {\n      const numColumns = numColumnsOrDefault(this.props.numColumns);\n      if (onViewableItemsChanged) {\n        if (numColumns > 1) {\n          const changed: Array<ViewToken> = [];\n          const viewableItems: Array<ViewToken> = [];\n          info.viewableItems.forEach(v =>\n            this._pushMultiColumnViewable(viewableItems, v),\n          );\n          info.changed.forEach(v => this._pushMultiColumnViewable(changed, v));\n          onViewableItemsChanged({viewableItems, changed});\n        } else {\n          onViewableItemsChanged(info);\n        }\n      }\n    };\n  }\n\n  _renderer = (\n    ListItemComponent: ?(React.ComponentType<any> | React.Element<any>),\n    renderItem: ?RenderItemType<ItemT>,\n    columnWrapperStyle: ?ViewStyleProp,\n    numColumns: ?number,\n    extraData: ?any,\n    // $FlowFixMe[missing-local-annot]\n  ) => {\n    const cols = numColumnsOrDefault(numColumns);\n\n    const render = (props: RenderItemProps<ItemT>): React.Node => {\n      if (ListItemComponent) {\n        // $FlowFixMe[not-a-component] Component isn't valid\n        // $FlowFixMe[incompatible-type-arg] Component isn't valid\n        // $FlowFixMe[incompatible-return] Component isn't valid\n        return <ListItemComponent {...props} />;\n      } else if (renderItem) {\n        // $FlowFixMe[incompatible-call]\n        return renderItem(props);\n      } else {\n        return null;\n      }\n    };\n\n    const renderProp = (info: RenderItemProps<ItemT>) => {\n      if (cols > 1) {\n        const {item, index} = info;\n        invariant(\n          Array.isArray(item),\n          'Expected array of items with numColumns > 1',\n        );\n        return (\n          <View style={[styles.row, columnWrapperStyle]}>\n            {item.map((it, kk) => {\n              const element = render({\n                // $FlowFixMe[incompatible-call]\n                item: it,\n                index: index * cols + kk,\n                separators: info.separators,\n              });\n              return element != null ? (\n                <React.Fragment key={kk}>{element}</React.Fragment>\n              ) : null;\n            })}\n          </View>\n        );\n      } else {\n        return render(info);\n      }\n    };\n\n    return ListItemComponent\n      ? {ListItemComponent: renderProp}\n      : {renderItem: renderProp};\n  };\n\n  // $FlowFixMe[missing-local-annot]\n  _memoizedRenderer = memoizeOne(this._renderer);\n\n  render(): React.Node {\n    const {\n      numColumns,\n      columnWrapperStyle,\n      removeClippedSubviews: _removeClippedSubviews,\n      strictMode = false,\n      ...restProps\n    } = this.props;\n\n    const renderer = strictMode ? this._memoizedRenderer : this._renderer;\n\n    return (\n      // $FlowFixMe[incompatible-exact] - `restProps` (`Props`) is inexact.\n      <VirtualizedList\n        {...restProps}\n        getItem={this._getItem}\n        getItemCount={this._getItemCount}\n        keyExtractor={this._keyExtractor}\n        ref={this._captureRef}\n        viewabilityConfigCallbackPairs={this._virtualizedListPairs}\n        removeClippedSubviews={removeClippedSubviewsOrDefault(\n          _removeClippedSubviews,\n        )}\n        {...renderer(\n          this.props.ListItemComponent,\n          this.props.renderItem,\n          columnWrapperStyle,\n          numColumns,\n          this.props.extraData,\n        )}\n      />\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  row: {flexDirection: 'row'},\n});\n\nexport default FlatList;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/JSEventLoopWatchdog/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * @flow\n */\n\n'use strict';\n\nimport infoLog from '../infoLog';\n\ntype Handler = {\n  onIterate?: () => void,\n  onStall: (params: {lastInterval: number, busyTime: number}) => ?string,\n};\n\n/**\n * A utility for tracking stalls in the JS event loop that prevent timers and\n * other events from being processed in a timely manner.\n *\n * The \"stall\" time is defined as the amount of time in access of the acceptable\n * threshold, which is typically around 100-200ms. So if the treshold is set to\n * 100 and a timer fires 150 ms later than it was scheduled because the event\n * loop was tied up, that would be considered a 50ms stall.\n *\n * By default, logs stall events to the console when installed. Can also be\n * queried with `getStats`.\n */\nconst JSEventLoopWatchdog = {\n  getStats: function(): Object {\n    return {stallCount, totalStallTime, longestStall, acceptableBusyTime};\n  },\n  reset: function() {\n    infoLog('JSEventLoopWatchdog: reset');\n    totalStallTime = 0;\n    stallCount = 0;\n    longestStall = 0;\n    lastInterval = window.performance.now();\n  },\n  addHandler: function(handler: Handler) {\n    handlers.push(handler);\n  },\n  install: function({thresholdMS}: {thresholdMS: number}) {\n    acceptableBusyTime = thresholdMS;\n    if (installed) {\n      return;\n    }\n    installed = true;\n    lastInterval = window.performance.now();\n    function iteration() {\n      const now = window.performance.now();\n      const busyTime = now - lastInterval;\n      if (busyTime >= thresholdMS) {\n        const stallTime = busyTime - thresholdMS;\n        stallCount++;\n        totalStallTime += stallTime;\n        longestStall = Math.max(longestStall, stallTime);\n        let msg =\n          `JSEventLoopWatchdog: JS thread busy for ${busyTime}ms. ` +\n          `${totalStallTime}ms in ${stallCount} stalls so far. `;\n        handlers.forEach(handler => {\n          msg += handler.onStall({lastInterval, busyTime}) || '';\n        });\n        infoLog(msg);\n      }\n      handlers.forEach(handler => {\n        handler.onIterate && handler.onIterate();\n      });\n      lastInterval = now;\n      setTimeout(iteration, thresholdMS / 5);\n    }\n    iteration();\n  },\n};\n\nlet acceptableBusyTime = 0;\nlet installed = false;\nlet totalStallTime = 0;\nlet stallCount = 0;\nlet longestStall = 0;\nlet lastInterval = 0;\nconst handlers: Array<Handler> = [];\n\nexport default JSEventLoopWatchdog;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/LayoutAnimation/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport Platform from '../../../exports/Platform';\nimport UIManager from '../../../exports/UIManager';\n\nconst __DEV__ = process.env.NODE_ENV !== 'production';\n\ntype Type =\n  | 'spring'\n  | 'linear'\n  | 'easeInEaseOut'\n  | 'easeIn'\n  | 'easeOut'\n  | 'keyboard';\n\ntype Property = 'opacity' | 'scaleX' | 'scaleY' | 'scaleXY';\n\ntype AnimationConfig = $ReadOnly<{|\n  duration?: number,\n  delay?: number,\n  springDamping?: number,\n  initialVelocity?: number,\n  type?: Type,\n  property?: Property,\n|}>;\n\ntype LayoutAnimationConfig = $ReadOnly<{|\n  duration: number,\n  create?: AnimationConfig,\n  update?: AnimationConfig,\n  delete?: AnimationConfig,\n|}>;\n\nfunction configureNext(\n  config: LayoutAnimationConfig,\n  onAnimationDidEnd?: Function,\n) {\n  if (!Platform.isTesting) {\n    UIManager.configureNextLayoutAnimation(\n      config,\n      onAnimationDidEnd ?? function() {},\n      function() {} /* unused onError */,\n    );\n  }\n}\n\nfunction create(\n  duration: number,\n  type: Type,\n  property: Property,\n): LayoutAnimationConfig {\n  return {\n    duration,\n    create: {type, property},\n    update: {type},\n    delete: {type, property},\n  };\n}\n\nconst Presets = {\n  easeInEaseOut: (create(300, 'easeInEaseOut', 'opacity'): LayoutAnimationConfig),\n  linear: (create(500, 'linear', 'opacity'): LayoutAnimationConfig),\n  spring: {\n    duration: 700,\n    create: {\n      type: 'linear',\n      property: 'opacity',\n    },\n    update: {\n      type: 'spring',\n      springDamping: 0.4,\n    },\n    delete: {\n      type: 'linear',\n      property: 'opacity',\n    },\n  },\n};\n\n/**\n * Automatically animates views to their new positions when the\n * next layout happens.\n *\n * A common way to use this API is to call it before calling `setState`.\n *\n * Note that in order to get this to work on **Android** you need to set the following flags via `UIManager`:\n *\n *     UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true);\n */\nconst LayoutAnimation = {\n  /**\n   * Schedules an animation to happen on the next layout.\n   *\n   * @param config Specifies animation properties:\n   *\n   *   - `duration` in milliseconds\n   *   - `create`, `AnimationConfig` for animating in new views\n   *   - `update`, `AnimationConfig` for animating views that have been updated\n   *\n   * @param onAnimationDidEnd Called when the animation finished.\n   * Only supported on iOS.\n   * @param onError Called on error. Only supported on iOS.\n   */\n  configureNext,\n  /**\n   * Helper for creating a config for `configureNext`.\n   */\n  create,\n  Types: Object.freeze({\n    spring: 'spring',\n    linear: 'linear',\n    easeInEaseOut: 'easeInEaseOut',\n    easeIn: 'easeIn',\n    easeOut: 'easeOut',\n    keyboard: 'keyboard',\n  }),\n  Properties: Object.freeze({\n    opacity: 'opacity',\n    scaleX: 'scaleX',\n    scaleY: 'scaleY',\n    scaleXY: 'scaleXY',\n  }),\n  checkConfig(...args: Array<mixed>) {\n    console.error('LayoutAnimation.checkConfig(...) has been disabled.');\n  },\n  Presets,\n  easeInEaseOut: (configureNext.bind(null, Presets.easeInEaseOut): (onAnimationDidEnd?: any) => void),\n  linear: (configureNext.bind(null, Presets.linear): (onAnimationDidEnd?: any) => void),\n  spring: (configureNext.bind(null, Presets.spring): (onAnimationDidEnd?: any) => void),\n};\n\nexport default LayoutAnimation;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/PanResponder/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport InteractionManager from '../../../exports/InteractionManager';\nimport TouchHistoryMath from '../TouchHistoryMath';\n\nimport type {PressEvent} from '../Types/CoreEventTypes';\n\nconst currentCentroidXOfTouchesChangedAfter =\n  TouchHistoryMath.currentCentroidXOfTouchesChangedAfter;\nconst currentCentroidYOfTouchesChangedAfter =\n  TouchHistoryMath.currentCentroidYOfTouchesChangedAfter;\nconst previousCentroidXOfTouchesChangedAfter =\n  TouchHistoryMath.previousCentroidXOfTouchesChangedAfter;\nconst previousCentroidYOfTouchesChangedAfter =\n  TouchHistoryMath.previousCentroidYOfTouchesChangedAfter;\nconst currentCentroidX = TouchHistoryMath.currentCentroidX;\nconst currentCentroidY = TouchHistoryMath.currentCentroidY;\n\n/**\n * `PanResponder` reconciles several touches into a single gesture. It makes\n * single-touch gestures resilient to extra touches, and can be used to\n * recognize simple multi-touch gestures.\n *\n * By default, `PanResponder` holds an `InteractionManager` handle to block\n * long-running JS events from interrupting active gestures.\n *\n * It provides a predictable wrapper of the responder handlers provided by the\n * [gesture responder system](docs/gesture-responder-system.html).\n * For each handler, it provides a new `gestureState` object alongside the\n * native event object:\n *\n * ```\n * onPanResponderMove: (event, gestureState) => {}\n * ```\n *\n * A native event is a synthetic touch event with the following form:\n *\n *  - `nativeEvent`\n *      + `changedTouches` - Array of all touch events that have changed since the last event\n *      + `identifier` - The ID of the touch\n *      + `locationX` - The X position of the touch, relative to the element\n *      + `locationY` - The Y position of the touch, relative to the element\n *      + `pageX` - The X position of the touch, relative to the root element\n *      + `pageY` - The Y position of the touch, relative to the root element\n *      + `target` - The node id of the element receiving the touch event\n *      + `timestamp` - A time identifier for the touch, useful for velocity calculation\n *      + `touches` - Array of all current touches on the screen\n *\n * A `gestureState` object has the following:\n *\n *  - `stateID` - ID of the gestureState- persisted as long as there at least\n *     one touch on screen\n *  - `moveX` - the latest screen coordinates of the recently-moved touch\n *  - `moveY` - the latest screen coordinates of the recently-moved touch\n *  - `x0` - the screen coordinates of the responder grant\n *  - `y0` - the screen coordinates of the responder grant\n *  - `dx` - accumulated distance of the gesture since the touch started\n *  - `dy` - accumulated distance of the gesture since the touch started\n *  - `vx` - current velocity of the gesture\n *  - `vy` - current velocity of the gesture\n *  - `numberActiveTouches` - Number of touches currently on screen\n *\n * ### Basic Usage\n *\n * ```\n *   componentWillMount: function() {\n *     this._panResponder = PanResponder.create({\n *       // Ask to be the responder:\n *       onStartShouldSetPanResponder: (evt, gestureState) => true,\n *       onStartShouldSetPanResponderCapture: (evt, gestureState) => true,\n *       onMoveShouldSetPanResponder: (evt, gestureState) => true,\n *       onMoveShouldSetPanResponderCapture: (evt, gestureState) => true,\n *\n *       onPanResponderGrant: (evt, gestureState) => {\n *         // The gesture has started. Show visual feedback so the user knows\n *         // what is happening!\n *\n *         // gestureState.d{x,y} will be set to zero now\n *       },\n *       onPanResponderMove: (evt, gestureState) => {\n *         // The most recent move distance is gestureState.move{X,Y}\n *\n *         // The accumulated gesture distance since becoming responder is\n *         // gestureState.d{x,y}\n *       },\n *       onPanResponderTerminationRequest: (evt, gestureState) => true,\n *       onPanResponderRelease: (evt, gestureState) => {\n *         // The user has released all touches while this view is the\n *         // responder. This typically means a gesture has succeeded\n *       },\n *       onPanResponderTerminate: (evt, gestureState) => {\n *         // Another component has become the responder, so this gesture\n *         // should be cancelled\n *       },\n *       onShouldBlockNativeResponder: (evt, gestureState) => {\n *         // Returns whether this component should block native components from becoming the JS\n *         // responder. Returns true by default. Is currently only supported on android.\n *         return true;\n *       },\n *     });\n *   },\n *\n *   render: function() {\n *     return (\n *       <View {...this._panResponder.panHandlers} />\n *     );\n *   },\n *\n * ```\n *\n * ### Working Example\n *\n * To see it in action, try the\n * [PanResponder example in RNTester](https://github.com/facebook/react-native/blob/master/RNTester/js/PanResponderExample.js)\n */\n\nexport type GestureState = {|\n  /**\n   * ID of the gestureState - persisted as long as there at least one touch on screen\n   */\n  stateID: number,\n\n  /**\n   * The latest screen coordinates of the recently-moved touch\n   */\n  moveX: number,\n\n  /**\n   * The latest screen coordinates of the recently-moved touch\n   */\n  moveY: number,\n\n  /**\n   * The screen coordinates of the responder grant\n   */\n  x0: number,\n\n  /**\n   * The screen coordinates of the responder grant\n   */\n  y0: number,\n\n  /**\n   * Accumulated distance of the gesture since the touch started\n   */\n  dx: number,\n\n  /**\n   * Accumulated distance of the gesture since the touch started\n   */\n  dy: number,\n\n  /**\n   * Current velocity of the gesture\n   */\n  vx: number,\n\n  /**\n   * Current velocity of the gesture\n   */\n  vy: number,\n\n  /**\n   * Number of touches currently on screen\n   */\n  numberActiveTouches: number,\n\n  /**\n   * All `gestureState` accounts for timeStamps up until this value\n   *\n   * @private\n   */\n  _accountsForMovesUpTo: number,\n|};\n\ntype ActiveCallback = (\n  event: PressEvent,\n  gestureState: GestureState,\n) => boolean;\n\ntype InteractionState = {handle: ?number, shouldCancelClick: boolean, timeout: ?TimeoutID};\n\ntype PassiveCallback = (event: PressEvent, gestureState: GestureState) => mixed;\n\ntype PanResponderConfig = $ReadOnly<{|\n  onMoveShouldSetPanResponder?: ?ActiveCallback,\n  onMoveShouldSetPanResponderCapture?: ?ActiveCallback,\n  onStartShouldSetPanResponder?: ?ActiveCallback,\n  onStartShouldSetPanResponderCapture?: ?ActiveCallback,\n  /**\n   * The body of `onResponderGrant` returns a bool, but the vast majority of\n   * callsites return void and this TODO notice is found in it:\n   *   TODO: t7467124 investigate if this can be removed\n   */\n  onPanResponderGrant?: ?(PassiveCallback | ActiveCallback),\n  onPanResponderReject?: ?PassiveCallback,\n  onPanResponderStart?: ?PassiveCallback,\n  onPanResponderEnd?: ?PassiveCallback,\n  onPanResponderRelease?: ?PassiveCallback,\n  onPanResponderMove?: ?PassiveCallback,\n  onPanResponderTerminate?: ?PassiveCallback,\n  onPanResponderTerminationRequest?: ?ActiveCallback,\n  onShouldBlockNativeResponder?: ?ActiveCallback,\n|}>;\n\nconst PanResponder = {\n  /**\n   *\n   * A graphical explanation of the touch data flow:\n   *\n   * +----------------------------+             +--------------------------------+\n   * | ResponderTouchHistoryStore |             |TouchHistoryMath                |\n   * +----------------------------+             +----------+---------------------+\n   * |Global store of touchHistory|             |Allocation-less math util       |\n   * |including activeness, start |             |on touch history (centroids     |\n   * |position, prev/cur position.|             |and multitouch movement etc)    |\n   * |                            |             |                                |\n   * +----^-----------------------+             +----^---------------------------+\n   *      |                                          |\n   *      | (records relevant history                |\n   *      |  of touches relevant for                 |\n   *      |  implementing higher level               |\n   *      |  gestures)                               |\n   *      |                                          |\n   * +----+-----------------------+             +----|---------------------------+\n   * | ResponderEventPlugin       |             |    |   Your App/Component      |\n   * +----------------------------+             +----|---------------------------+\n   * |Negotiates which view gets  | Low level   |    |             High level    |\n   * |onResponderMove events.     | events w/   |  +-+-------+     events w/     |\n   * |Also records history into   | touchHistory|  |   Pan   |     multitouch +  |\n   * |ResponderTouchHistoryStore. +---------------->Responder+-----> accumulative|\n   * +----------------------------+ attached to |  |         |     distance and  |\n   *                                 each event |  +---------+     velocity.     |\n   *                                            |                                |\n   *                                            |                                |\n   *                                            +--------------------------------+\n   *\n   *\n   *\n   * Gesture that calculates cumulative movement over time in a way that just\n   * \"does the right thing\" for multiple touches. The \"right thing\" is very\n   * nuanced. When moving two touches in opposite directions, the cumulative\n   * distance is zero in each dimension. When two touches move in parallel five\n   * pixels in the same direction, the cumulative distance is five, not ten. If\n   * two touches start, one moves five in a direction, then stops and the other\n   * touch moves fives in the same direction, the cumulative distance is ten.\n   *\n   * This logic requires a kind of processing of time \"clusters\" of touch events\n   * so that two touch moves that essentially occur in parallel but move every\n   * other frame respectively, are considered part of the same movement.\n   *\n   * Explanation of some of the non-obvious fields:\n   *\n   * - moveX/moveY: If no move event has been observed, then `(moveX, moveY)` is\n   *   invalid. If a move event has been observed, `(moveX, moveY)` is the\n   *   centroid of the most recently moved \"cluster\" of active touches.\n   *   (Currently all move have the same timeStamp, but later we should add some\n   *   threshold for what is considered to be \"moving\"). If a palm is\n   *   accidentally counted as a touch, but a finger is moving greatly, the palm\n   *   will move slightly, but we only want to count the single moving touch.\n   * - x0/y0: Centroid location (non-cumulative) at the time of becoming\n   *   responder.\n   * - dx/dy: Cumulative touch distance - not the same thing as sum of each touch\n   *   distance. Accounts for touch moves that are clustered together in time,\n   *   moving the same direction. Only valid when currently responder (otherwise,\n   *   it only represents the drag distance below the threshold).\n   * - vx/vy: Velocity.\n   */\n\n  _initializeGestureState(gestureState: GestureState) {\n    gestureState.moveX = 0;\n    gestureState.moveY = 0;\n    gestureState.x0 = 0;\n    gestureState.y0 = 0;\n    gestureState.dx = 0;\n    gestureState.dy = 0;\n    gestureState.vx = 0;\n    gestureState.vy = 0;\n    gestureState.numberActiveTouches = 0;\n    // All `gestureState` accounts for timeStamps up until:\n    gestureState._accountsForMovesUpTo = 0;\n  },\n\n  /**\n   * This is nuanced and is necessary. It is incorrect to continuously take all\n   * active *and* recently moved touches, find the centroid, and track how that\n   * result changes over time. Instead, we must take all recently moved\n   * touches, and calculate how the centroid has changed just for those\n   * recently moved touches, and append that change to an accumulator. This is\n   * to (at least) handle the case where the user is moving three fingers, and\n   * then one of the fingers stops but the other two continue.\n   *\n   * This is very different than taking all of the recently moved touches and\n   * storing their centroid as `dx/dy`. For correctness, we must *accumulate\n   * changes* in the centroid of recently moved touches.\n   *\n   * There is also some nuance with how we handle multiple moved touches in a\n   * single event. With the way `ReactNativeEventEmitter` dispatches touches as\n   * individual events, multiple touches generate two 'move' events, each of\n   * them triggering `onResponderMove`. But with the way `PanResponder` works,\n   * all of the gesture inference is performed on the first dispatch, since it\n   * looks at all of the touches (even the ones for which there hasn't been a\n   * native dispatch yet). Therefore, `PanResponder` does not call\n   * `onResponderMove` passed the first dispatch. This diverges from the\n   * typical responder callback pattern (without using `PanResponder`), but\n   * avoids more dispatches than necessary.\n   */\n  _updateGestureStateOnMove(\n    gestureState: GestureState,\n    touchHistory: $PropertyType<PressEvent, 'touchHistory'>,\n  ) {\n    gestureState.numberActiveTouches = touchHistory.numberActiveTouches;\n    gestureState.moveX = currentCentroidXOfTouchesChangedAfter(\n      touchHistory,\n      gestureState._accountsForMovesUpTo,\n    );\n    gestureState.moveY = currentCentroidYOfTouchesChangedAfter(\n      touchHistory,\n      gestureState._accountsForMovesUpTo,\n    );\n    const movedAfter = gestureState._accountsForMovesUpTo;\n    const prevX = previousCentroidXOfTouchesChangedAfter(\n      touchHistory,\n      movedAfter,\n    );\n    const x = currentCentroidXOfTouchesChangedAfter(touchHistory, movedAfter);\n    const prevY = previousCentroidYOfTouchesChangedAfter(\n      touchHistory,\n      movedAfter,\n    );\n    const y = currentCentroidYOfTouchesChangedAfter(touchHistory, movedAfter);\n    const nextDX = gestureState.dx + (x - prevX);\n    const nextDY = gestureState.dy + (y - prevY);\n\n    // TODO: This must be filtered intelligently.\n    const dt =\n      touchHistory.mostRecentTimeStamp - gestureState._accountsForMovesUpTo;\n    gestureState.vx = (nextDX - gestureState.dx) / dt;\n    gestureState.vy = (nextDY - gestureState.dy) / dt;\n\n    gestureState.dx = nextDX;\n    gestureState.dy = nextDY;\n    gestureState._accountsForMovesUpTo = touchHistory.mostRecentTimeStamp;\n  },\n\n  /**\n   * @param {object} config Enhanced versions of all of the responder callbacks\n   * that provide not only the typical `ResponderSyntheticEvent`, but also the\n   * `PanResponder` gesture state.  Simply replace the word `Responder` with\n   * `PanResponder` in each of the typical `onResponder*` callbacks. For\n   * example, the `config` object would look like:\n   *\n   *  - `onMoveShouldSetPanResponder: (e, gestureState) => {...}`\n   *  - `onMoveShouldSetPanResponderCapture: (e, gestureState) => {...}`\n   *  - `onStartShouldSetPanResponder: (e, gestureState) => {...}`\n   *  - `onStartShouldSetPanResponderCapture: (e, gestureState) => {...}`\n   *  - `onPanResponderReject: (e, gestureState) => {...}`\n   *  - `onPanResponderGrant: (e, gestureState) => {...}`\n   *  - `onPanResponderStart: (e, gestureState) => {...}`\n   *  - `onPanResponderEnd: (e, gestureState) => {...}`\n   *  - `onPanResponderRelease: (e, gestureState) => {...}`\n   *  - `onPanResponderMove: (e, gestureState) => {...}`\n   *  - `onPanResponderTerminate: (e, gestureState) => {...}`\n   *  - `onPanResponderTerminationRequest: (e, gestureState) => {...}`\n   *  - `onShouldBlockNativeResponder: (e, gestureState) => {...}`\n   *\n   *  In general, for events that have capture equivalents, we update the\n   *  gestureState once in the capture phase and can use it in the bubble phase\n   *  as well.\n   *\n   *  Be careful with onStartShould* callbacks. They only reflect updated\n   *  `gestureState` for start/end events that bubble/capture to the Node.\n   *  Once the node is the responder, you can rely on every start/end event\n   *  being processed by the gesture and `gestureState` being updated\n   *  accordingly. (numberActiveTouches) may not be totally accurate unless you\n   *  are the responder.\n   */\n  create(config: PanResponderConfig): {|\n  getInteractionHandle: () => ?number,\n  panHandlers: {|\n    onClickCapture: (event: any) => void,\n    onMoveShouldSetResponder: (event: PressEvent) => boolean,\n    onMoveShouldSetResponderCapture: (event: PressEvent) => boolean,\n    onResponderEnd: (event: PressEvent) => void,\n    onResponderGrant: (event: PressEvent) => boolean,\n    onResponderMove: (event: PressEvent) => void,\n    onResponderReject: (event: PressEvent) => void,\n    onResponderRelease: (event: PressEvent) => void,\n    onResponderStart: (event: PressEvent) => void,\n    onResponderTerminate: (event: PressEvent) => void,\n    onResponderTerminationRequest: (event: PressEvent) => boolean,\n    onStartShouldSetResponder: (event: PressEvent) => boolean,\n    onStartShouldSetResponderCapture: (event: PressEvent) => boolean,\n  |},\n|} {\n    const interactionState: InteractionState = {\n      handle: null,\n      shouldCancelClick: false,\n      timeout: null,\n    };\n\n    const gestureState: GestureState = {\n      // Useful for debugging\n      stateID: Math.random(),\n      moveX: 0,\n      moveY: 0,\n      x0: 0,\n      y0: 0,\n      dx: 0,\n      dy: 0,\n      vx: 0,\n      vy: 0,\n      numberActiveTouches: 0,\n      _accountsForMovesUpTo: 0,\n    };\n    const panHandlers = {\n      onStartShouldSetResponder(event: PressEvent): boolean {\n        return config.onStartShouldSetPanResponder == null\n          ? false\n          : config.onStartShouldSetPanResponder(event, gestureState);\n      },\n      onMoveShouldSetResponder(event: PressEvent): boolean {\n        return config.onMoveShouldSetPanResponder == null\n          ? false\n          : config.onMoveShouldSetPanResponder(event, gestureState);\n      },\n      onStartShouldSetResponderCapture(event: PressEvent): boolean {\n        // TODO: Actually, we should reinitialize the state any time\n        // touches.length increases from 0 active to > 0 active.\n        if (event.nativeEvent.touches.length === 1) {\n          PanResponder._initializeGestureState(gestureState);\n        }\n        gestureState.numberActiveTouches =\n          event.touchHistory.numberActiveTouches;\n        return config.onStartShouldSetPanResponderCapture != null\n          ? config.onStartShouldSetPanResponderCapture(event, gestureState)\n          : false;\n      },\n\n      onMoveShouldSetResponderCapture(event: PressEvent): boolean {\n        const touchHistory = event.touchHistory;\n        // Responder system incorrectly dispatches should* to current responder\n        // Filter out any touch moves past the first one - we would have\n        // already processed multi-touch geometry during the first event.\n        if (\n          gestureState._accountsForMovesUpTo ===\n          touchHistory.mostRecentTimeStamp\n        ) {\n          return false;\n        }\n        PanResponder._updateGestureStateOnMove(gestureState, touchHistory);\n        return config.onMoveShouldSetPanResponderCapture\n          ? config.onMoveShouldSetPanResponderCapture(event, gestureState)\n          : false;\n      },\n\n      onResponderGrant(event: PressEvent): boolean {\n        if (!interactionState.handle) {\n          interactionState.handle = InteractionManager.createInteractionHandle();\n        }\n        if (interactionState.timeout) {\n          clearInteractionTimeout(interactionState);\n        }\n        interactionState.shouldCancelClick = true;\n        gestureState.x0 = currentCentroidX(event.touchHistory);\n        gestureState.y0 = currentCentroidY(event.touchHistory);\n        gestureState.dx = 0;\n        gestureState.dy = 0;\n        if (config.onPanResponderGrant) {\n          config.onPanResponderGrant(event, gestureState);\n        }\n        // TODO: t7467124 investigate if this can be removed\n        return config.onShouldBlockNativeResponder == null\n          ? true\n          : config.onShouldBlockNativeResponder(event, gestureState);\n      },\n\n      onResponderReject(event: PressEvent): void {\n        clearInteractionHandle(\n          interactionState,\n          config.onPanResponderReject,\n          event,\n          gestureState,\n        );\n      },\n\n      onResponderRelease(event: PressEvent): void {\n        clearInteractionHandle(\n          interactionState,\n          config.onPanResponderRelease,\n          event,\n          gestureState,\n        );\n        setInteractionTimeout(interactionState);\n        PanResponder._initializeGestureState(gestureState);\n      },\n\n      onResponderStart(event: PressEvent): void {\n        const touchHistory = event.touchHistory;\n        gestureState.numberActiveTouches = touchHistory.numberActiveTouches;\n        if (config.onPanResponderStart) {\n          config.onPanResponderStart(event, gestureState);\n        }\n      },\n\n      onResponderMove(event: PressEvent): void {\n        const touchHistory = event.touchHistory;\n        // Guard against the dispatch of two touch moves when there are two\n        // simultaneously changed touches.\n        if (\n          gestureState._accountsForMovesUpTo ===\n          touchHistory.mostRecentTimeStamp\n        ) {\n          return;\n        }\n        // Filter out any touch moves past the first one - we would have\n        // already processed multi-touch geometry during the first event.\n        PanResponder._updateGestureStateOnMove(gestureState, touchHistory);\n        if (config.onPanResponderMove) {\n          config.onPanResponderMove(event, gestureState);\n        }\n      },\n\n      onResponderEnd(event: PressEvent): void {\n        const touchHistory = event.touchHistory;\n        gestureState.numberActiveTouches = touchHistory.numberActiveTouches;\n        clearInteractionHandle(\n          interactionState,\n          config.onPanResponderEnd,\n          event,\n          gestureState,\n        );\n      },\n\n      onResponderTerminate(event: PressEvent): void {\n        clearInteractionHandle(\n          interactionState,\n          config.onPanResponderTerminate,\n          event,\n          gestureState,\n        );\n        setInteractionTimeout(interactionState);\n        PanResponder._initializeGestureState(gestureState);\n      },\n\n      onResponderTerminationRequest(event: PressEvent): boolean {\n        return config.onPanResponderTerminationRequest == null\n          ? true\n          : config.onPanResponderTerminationRequest(event, gestureState);\n      },\n\n      // We do not want to trigger 'click' activated gestures or native behaviors\n      // on any pan target that is under a mouse cursor when it is released.\n      // Browsers will natively cancel 'click' events on a target if a non-mouse\n      // active pointer moves.\n      onClickCapture: (event: any): void => {\n        if (interactionState.shouldCancelClick === true) {\n          event.stopPropagation();\n          event.preventDefault();\n        }\n      },\n    };\n\n    return {\n      panHandlers,\n      getInteractionHandle(): ?number {\n        return interactionState.handle;\n      },\n    };\n  },\n};\n\nfunction clearInteractionHandle(\n  interactionState: InteractionState,\n  callback: ?(ActiveCallback | PassiveCallback),\n  event: PressEvent,\n  gestureState: GestureState,\n) {\n  if (interactionState.handle) {\n    InteractionManager.clearInteractionHandle(interactionState.handle);\n    interactionState.handle = null;\n  }\n  if (callback) {\n    callback(event, gestureState);\n  }\n}\n\nfunction clearInteractionTimeout(interactionState: InteractionState) {\n  clearTimeout(interactionState.timeout);\n}\n\nfunction setInteractionTimeout(interactionState: InteractionState) {\n  interactionState.timeout = setTimeout(() => {\n    interactionState.shouldCancelClick = false;\n  }, 250);\n}\n\nexport type PanResponderInstance = $Call<\n  $PropertyType<typeof PanResponder, 'create'>,\n  PanResponderConfig,\n>;\n\nexport default PanResponder;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/PooledClass/index.js",
    "content": "/* eslint-disable */\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * From React 16.0.0\n */\n\nimport invariant from 'fbjs/lib/invariant';\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 standardReleaser = function(instance) {\n  var Klass = this;\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 = twoArgumentPooler;\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.\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  // Casting as any so that flow ignores the actual implementation and trusts\n  // it to match the type we declared\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  twoArgumentPooler: twoArgumentPooler\n};\n\nexport default PooledClass;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/ReactNative/ReactNativeFeatureFlags.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\n'use strict';\n\nexport type FeatureFlags = {|\n  /**\n   * Function used to enable / disabled Layout Animations in React Native.\n   * Default value = true.\n   */\n  isLayoutAnimationEnabled: () => boolean,\n  /**\n   * Function used to enable / disable W3C pointer event emitting in React Native.\n   * If enabled you must also flip the equivalent native flags on each platform:\n   * iOS -> RCTSetDispatchW3CPointerEvents\n   * Android -> ReactFeatureFlags.dispatchPointerEvents\n   */\n  shouldEmitW3CPointerEvents: () => boolean,\n  /**\n   * Function used to enable / disable Pressibility from using W3C Pointer Events\n   * for its hover callbacks\n   */\n  shouldPressibilityUseW3CPointerEventsForHover: () => boolean,\n  /**\n   * Enables an experimental flush-queue debouncing in Animated.js.\n   */\n  animatedShouldDebounceQueueFlush: () => boolean,\n  /**\n   * Enables an experimental mega-operation for Animated.js that replaces\n   * many calls to native with a single call into native, to reduce JSI/JNI\n   * traffic.\n   */\n  animatedShouldUseSingleOp: () => boolean,\n|};\n\nconst ReactNativeFeatureFlags: FeatureFlags = {\n  isLayoutAnimationEnabled: () => true,\n  shouldEmitW3CPointerEvents: () => false,\n  shouldPressibilityUseW3CPointerEventsForHover: () => false,\n  animatedShouldDebounceQueueFlush: () => false,\n  animatedShouldUseSingleOp: () => false,\n};\n\nexport default ReactNativeFeatureFlags;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/SHA",
    "content": "facebook/react-native@0.60.0-rc.3\nfacebook/react-native@8a43321271bd58bbe0bca27593e121077d7a4065\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/SectionList/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport Platform from '../../../exports/Platform';\nimport * as React from 'react';\nimport VirtualizedSectionList from '../VirtualizedSectionList';\n\ntype ScrollResponderType = any;\nimport type {\n  SectionBase as _SectionBase,\n  Props as VirtualizedSectionListProps,\n  ScrollToLocationParamsType,\n} from '../VirtualizedSectionList';\n\ntype Item = any;\n\nexport type SectionBase<SectionItemT> = _SectionBase<SectionItemT>;\n\ntype RequiredProps<SectionT: SectionBase<any>> = {|\n  /**\n   * The actual data to render, akin to the `data` prop in [`<FlatList>`](https://reactnative.dev/docs/flatlist).\n   *\n   * General shape:\n   *\n   *     sections: $ReadOnlyArray<{\n   *       data: $ReadOnlyArray<SectionItem>,\n   *       renderItem?: ({item: SectionItem, ...}) => ?React.Element<*>,\n   *       ItemSeparatorComponent?: ?ReactClass<{highlighted: boolean, ...}>,\n   *     }>\n   */\n  sections: $ReadOnlyArray<SectionT>,\n|};\n\ntype OptionalProps<SectionT: SectionBase<any>> = {|\n  /**\n   * Default renderer for every item in every section. Can be over-ridden on a per-section basis.\n   */\n  renderItem?: (info: {\n    item: Item,\n    index: number,\n    section: SectionT,\n    separators: {\n      highlight: () => void,\n      unhighlight: () => void,\n      updateProps: (select: 'leading' | 'trailing', newProps: Object) => void,\n      ...\n    },\n    ...\n  }) => null | React.Element<any>,\n  /**\n   * A marker property for telling the list to re-render (since it implements `PureComponent`). If\n   * any of your `renderItem`, Header, Footer, etc. functions depend on anything outside of the\n   * `data` prop, stick it here and treat it immutably.\n   */\n  extraData?: any,\n  /**\n   * How many items to render in the initial batch. This should be enough to fill the screen but not\n   * much more. Note these items will never be unmounted as part of the windowed rendering in order\n   * to improve perceived performance of scroll-to-top actions.\n   */\n  initialNumToRender?: ?number,\n  /**\n   * Reverses the direction of scroll. Uses scale transforms of -1.\n   */\n  inverted?: ?boolean,\n  /**\n   * Used to extract a unique key for a given item at the specified index. Key is used for caching\n   * and as the react key to track item re-ordering. The default extractor checks item.key, then\n   * falls back to using the index, like react does. Note that this sets keys for each item, but\n   * each overall section still needs its own key.\n   */\n  keyExtractor?: ?(item: Item, index: number) => string,\n  /**\n   * Called once when the scroll position gets within `onEndReachedThreshold` of the rendered\n   * content.\n   */\n  onEndReached?: ?(info: {distanceFromEnd: number, ...}) => void,\n  /**\n   * Note: may have bugs (missing content) in some circumstances - use at your own risk.\n   *\n   * This may improve scroll performance for large lists.\n   */\n  removeClippedSubviews?: boolean,\n|};\n\nexport type Props<SectionT> = {|\n  ...$Diff<\n    VirtualizedSectionListProps<SectionT>,\n    {\n      getItem: $PropertyType<VirtualizedSectionListProps<SectionT>, 'getItem'>,\n      getItemCount: $PropertyType<\n        VirtualizedSectionListProps<SectionT>,\n        'getItemCount',\n      >,\n      renderItem: $PropertyType<\n        VirtualizedSectionListProps<SectionT>,\n        'renderItem',\n      >,\n      keyExtractor: $PropertyType<\n        VirtualizedSectionListProps<SectionT>,\n        'keyExtractor',\n      >,\n      ...\n    },\n  >,\n  ...RequiredProps<SectionT>,\n  ...OptionalProps<SectionT>,\n|};\n\n/**\n * A performant interface for rendering sectioned lists, supporting the most handy features:\n *\n *  - Fully cross-platform.\n *  - Configurable viewability callbacks.\n *  - List header support.\n *  - List footer support.\n *  - Item separator support.\n *  - Section header support.\n *  - Section separator support.\n *  - Heterogeneous data and item rendering support.\n *  - Pull to Refresh.\n *  - Scroll loading.\n *\n * If you don't need section support and want a simpler interface, use\n * [`<FlatList>`](https://reactnative.dev/docs/flatlist).\n *\n * Simple Examples:\n *\n *     <SectionList\n *       renderItem={({item}) => <ListItem title={item} />}\n *       renderSectionHeader={({section}) => <Header title={section.title} />}\n *       sections={[ // homogeneous rendering between sections\n *         {data: [...], title: ...},\n *         {data: [...], title: ...},\n *         {data: [...], title: ...},\n *       ]}\n *     />\n *\n *     <SectionList\n *       sections={[ // heterogeneous rendering between sections\n *         {data: [...], renderItem: ...},\n *         {data: [...], renderItem: ...},\n *         {data: [...], renderItem: ...},\n *       ]}\n *     />\n *\n * This is a convenience wrapper around [`<VirtualizedList>`](docs/virtualizedlist),\n * and thus inherits its props (as well as those of `ScrollView`) that aren't explicitly listed\n * here, along with the following caveats:\n *\n * - Internal state is not preserved when content scrolls out of the render window. Make sure all\n *   your data is captured in the item data or external stores like Flux, Redux, or Relay.\n * - This is a `PureComponent` which means that it will not re-render if `props` remain shallow-\n *   equal. Make sure that everything your `renderItem` function depends on is passed as a prop\n *   (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on\n *   changes. This includes the `data` prop and parent component state.\n * - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously\n *   offscreen. This means it's possible to scroll faster than the fill rate and momentarily see\n *   blank content. This is a tradeoff that can be adjusted to suit the needs of each application,\n *   and we are working on improving it behind the scenes.\n * - By default, the list looks for a `key` prop on each item and uses that for the React key.\n *   Alternatively, you can provide a custom `keyExtractor` prop.\n *\n */\nexport default class SectionList<\n  SectionT: SectionBase<any>,\n> extends React.PureComponent<Props<SectionT>, void> {\n  props: Props<SectionT>;\n\n  /**\n   * Scrolls to the item at the specified `sectionIndex` and `itemIndex` (within the section)\n   * positioned in the viewable area such that `viewPosition` 0 places it at the top (and may be\n   * covered by a sticky header), 1 at the bottom, and 0.5 centered in the middle. `viewOffset` is a\n   * fixed number of pixels to offset the final target position, e.g. to compensate for sticky\n   * headers.\n   *\n   * Note: cannot scroll to locations outside the render window without specifying the\n   * `getItemLayout` prop.\n   */\n  scrollToLocation(params: ScrollToLocationParamsType) {\n    if (this._wrapperListRef != null) {\n      this._wrapperListRef.scrollToLocation(params);\n    }\n  }\n\n  /**\n   * Tells the list an interaction has occurred, which should trigger viewability calculations, e.g.\n   * if `waitForInteractions` is true and the user has not scrolled. This is typically called by\n   * taps on items or by navigation actions.\n   */\n  recordInteraction() {\n    const listRef = this._wrapperListRef && this._wrapperListRef.getListRef();\n    listRef && listRef.recordInteraction();\n  }\n\n  /**\n   * Displays the scroll indicators momentarily.\n   *\n   * @platform ios\n   */\n  flashScrollIndicators() {\n    const listRef = this._wrapperListRef && this._wrapperListRef.getListRef();\n    listRef && listRef.flashScrollIndicators();\n  }\n\n  /**\n   * Provides a handle to the underlying scroll responder.\n   */\n  getScrollResponder(): ?ScrollResponderType {\n    const listRef = this._wrapperListRef && this._wrapperListRef.getListRef();\n    if (listRef) {\n      return listRef.getScrollResponder();\n    }\n  }\n\n  getScrollableNode(): any {\n    const listRef = this._wrapperListRef && this._wrapperListRef.getListRef();\n    if (listRef) {\n      return listRef.getScrollableNode();\n    }\n  }\n\n  render(): React.Node {\n    const {\n      stickySectionHeadersEnabled: _stickySectionHeadersEnabled,\n      ...restProps\n    } = this.props;\n    const stickySectionHeadersEnabled =\n      _stickySectionHeadersEnabled ?? Platform.OS === 'ios';\n    return (\n      <VirtualizedSectionList\n        {...restProps}\n        stickySectionHeadersEnabled={stickySectionHeadersEnabled}\n        ref={this._captureRef}\n        getItemCount={items => items.length}\n        getItem={(items, index) => items[index]}\n      />\n    );\n  }\n\n  _wrapperListRef: ?React.ElementRef<typeof VirtualizedSectionList>;\n  _captureRef = ref => {\n    this._wrapperListRef = ref;\n  };\n}\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/StaticContainer/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * @flow strict-local\n */\n\n'use strict';\n\nimport * as React from 'react';\n\n/**\n * Renders static content efficiently by allowing React to short-circuit the\n * reconciliation process. This component should be used when you know that a\n * subtree of components will never need to be updated.\n *\n *   const someValue = ...; // We know for certain this value will never change.\n *   return (\n *     <StaticContainer>\n *       <MyComponent value={someValue} />\n *     </StaticContainer>\n *   );\n *\n * Typically, you will not need to use this component and should opt for normal\n * React reconciliation.\n */\n\ntype Props = $ReadOnly<{|\n  /**\n   * Whether or not this component should update.\n   */\n  shouldUpdate: ?boolean,\n  /**\n   * Content short-circuited by React reconciliation process.\n   */\n  children: React.Node,\n|}>;\nclass StaticContainer extends React.Component<Props> {\n  shouldComponentUpdate(nextProps: Props): boolean {\n    return !!nextProps.shouldUpdate;\n  }\n\n  render(): null | React.Node {\n    const child = this.props.children;\n    return child === null || child === false\n      ? null\n      : React.Children.only(child);\n  }\n}\n\nexport default StaticContainer;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/StaticRenderer/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * @flow\n */\n\n'use strict';\n\nimport * as React from 'react';\n\ntype Props = $ReadOnly<{|\n  /**\n   * Indicates whether the render function needs to be called again\n   */\n  shouldUpdate: boolean,\n  /**\n   * () => renderable\n   * A function that returns a renderable component\n   */\n  render: () => React.Node,\n|}>;\n\nclass StaticRenderer extends React.Component<Props> {\n  shouldComponentUpdate(nextProps: Props): boolean {\n    return nextProps.shouldUpdate;\n  }\n\n  render(): React.Node {\n    return this.props.render();\n  }\n}\n\nexport default StaticRenderer;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/TouchHistoryMath/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\n\nconst TouchHistoryMath = {\n  /**\n   * This code is optimized and not intended to look beautiful. This allows\n   * computing of touch centroids that have moved after `touchesChangedAfter`\n   * timeStamp. You can compute the current centroid involving all touches\n   * moves after `touchesChangedAfter`, or you can compute the previous\n   * centroid of all touches that were moved after `touchesChangedAfter`.\n   *\n   * @param {TouchHistoryMath} touchHistory Standard Responder touch track\n   * data.\n   * @param {number} touchesChangedAfter timeStamp after which moved touches\n   * are considered \"actively moving\" - not just \"active\".\n   * @param {boolean} isXAxis Consider `x` dimension vs. `y` dimension.\n   * @param {boolean} ofCurrent Compute current centroid for actively moving\n   * touches vs. previous centroid of now actively moving touches.\n   * @return {number} value of centroid in specified dimension.\n   */\n  centroidDimension: function(\n    touchHistory,\n    touchesChangedAfter,\n    isXAxis,\n    ofCurrent,\n  ) {\n    const touchBank = touchHistory.touchBank;\n    let total = 0;\n    let count = 0;\n\n    const oneTouchData =\n      touchHistory.numberActiveTouches === 1\n        ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch]\n        : null;\n\n    if (oneTouchData !== null) {\n      if (\n        oneTouchData.touchActive &&\n        oneTouchData.currentTimeStamp > touchesChangedAfter\n      ) {\n        total +=\n          ofCurrent && isXAxis\n            ? oneTouchData.currentPageX\n            : ofCurrent && !isXAxis\n            ? oneTouchData.currentPageY\n            : !ofCurrent && isXAxis\n            ? oneTouchData.previousPageX\n            : oneTouchData.previousPageY;\n        count = 1;\n      }\n    } else {\n      for (let i = 0; i < touchBank.length; i++) {\n        const touchTrack = touchBank[i];\n        if (\n          touchTrack !== null &&\n          touchTrack !== undefined &&\n          touchTrack.touchActive &&\n          touchTrack.currentTimeStamp >= touchesChangedAfter\n        ) {\n          let toAdd; // Yuck, program temporarily in invalid state.\n          if (ofCurrent && isXAxis) {\n            toAdd = touchTrack.currentPageX;\n          } else if (ofCurrent && !isXAxis) {\n            toAdd = touchTrack.currentPageY;\n          } else if (!ofCurrent && isXAxis) {\n            toAdd = touchTrack.previousPageX;\n          } else {\n            toAdd = touchTrack.previousPageY;\n          }\n          total += toAdd;\n          count++;\n        }\n      }\n    }\n    return count > 0 ? total / count : TouchHistoryMath.noCentroid;\n  },\n\n  currentCentroidXOfTouchesChangedAfter: function(\n    touchHistory,\n    touchesChangedAfter,\n  ) {\n    return TouchHistoryMath.centroidDimension(\n      touchHistory,\n      touchesChangedAfter,\n      true, // isXAxis\n      true, // ofCurrent\n    );\n  },\n\n  currentCentroidYOfTouchesChangedAfter: function(\n    touchHistory,\n    touchesChangedAfter,\n  ) {\n    return TouchHistoryMath.centroidDimension(\n      touchHistory,\n      touchesChangedAfter,\n      false, // isXAxis\n      true, // ofCurrent\n    );\n  },\n\n  previousCentroidXOfTouchesChangedAfter: function(\n    touchHistory,\n    touchesChangedAfter,\n  ) {\n    return TouchHistoryMath.centroidDimension(\n      touchHistory,\n      touchesChangedAfter,\n      true, // isXAxis\n      false, // ofCurrent\n    );\n  },\n\n  previousCentroidYOfTouchesChangedAfter: function(\n    touchHistory,\n    touchesChangedAfter,\n  ) {\n    return TouchHistoryMath.centroidDimension(\n      touchHistory,\n      touchesChangedAfter,\n      false, // isXAxis\n      false, // ofCurrent\n    );\n  },\n\n  currentCentroidX: function(touchHistory) {\n    return TouchHistoryMath.centroidDimension(\n      touchHistory,\n      0, // touchesChangedAfter\n      true, // isXAxis\n      true, // ofCurrent\n    );\n  },\n\n  currentCentroidY: function(touchHistory) {\n    return TouchHistoryMath.centroidDimension(\n      touchHistory,\n      0, // touchesChangedAfter\n      false, // isXAxis\n      true, // ofCurrent\n    );\n  },\n\n  noCentroid: -1,\n};\n\nexport default TouchHistoryMath;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/TurboModule/RCTExport.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict\n * @format\n */\n\n'use strict';\n\n/**\n * NOTE: This is React Native specific export type.\n *\n * RCTExport is an interface type that allows native code generation for React\n * Native native modules. It exists as a hint to the codegen tool that any\n * interface that extends it needs to be codegen'ed. Example usage:\n *\n *   export interface RCTFoobar extends RCTExport<void> {}\n *\n * Native definition for RCTFoobar will then be generated.\n *\n * The type param T is a placeholder for future codegen hinting, like versioning\n * information, native base classes, etc. For now, simply use `void` type as\n * there's nothing to give hint about.\n */\n\n// eslint-disable-next-line no-unused-vars\nexport interface RCTExport<T: void = void> {\n  +getConstants?: () => {};\n}\n\n// eslint-disable-next-line lint/react-native-modules\nexport interface TurboModule extends RCTExport<void> {}\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/TurboModule/TurboModuleRegistry.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport type {TurboModule} from './RCTExport';\nimport invariant from 'fbjs/lib/invariant';\n\nexport function get<T: TurboModule>(name: string): ?T {\n  return null;\n}\n\nexport function getEnforcing<T: TurboModule>(name: string): T {\n  const module = get(name);\n  invariant(\n    module != null,\n    `TurboModuleRegistry.getEnforcing(...): '${name}' could not be found. ` +\n      'Verify that a module by this name is registered in the native binary.',\n  );\n  return module;\n}\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Types/CoreEventTypes.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict\n * @format\n */\n\n'use strict';\n\nexport type SyntheticEvent<+T> = $ReadOnly<{|\n  bubbles: ?boolean,\n  cancelable: ?boolean,\n  currentTarget: HTMLElement,\n  defaultPrevented: ?boolean,\n  dispatchConfig: $ReadOnly<{|\n    registrationName: string,\n  |}>,\n  eventPhase: ?number,\n  preventDefault: () => void,\n  isDefaultPrevented: () => boolean,\n  stopPropagation: () => void,\n  isPropagationStopped: () => boolean,\n  isTrusted: ?boolean,\n  nativeEvent: T,\n  persist: () => void,\n  target: ?HTMLElement,\n  timeStamp: number,\n  type: ?string,\n|}>;\n\nexport type ResponderSyntheticEvent<T> = $ReadOnly<{|\n  ...SyntheticEvent<T>,\n  touchHistory: $ReadOnly<{|\n    indexOfSingleActiveTouch: number,\n    mostRecentTimeStamp: number,\n    numberActiveTouches: number,\n    touchBank: $ReadOnlyArray<\n      $ReadOnly<{|\n        touchActive: boolean,\n        startPageX: number,\n        startPageY: number,\n        startTimeStamp: number,\n        currentPageX: number,\n        currentPageY: number,\n        currentTimeStamp: number,\n        previousPageX: number,\n        previousPageY: number,\n        previousTimeStamp: number,\n      |}>,\n    >,\n  |}>,\n|}>;\n\nexport type Layout = $ReadOnly<{|\n  x: number,\n  y: number,\n  width: number,\n  height: number,\n|}>;\n\nexport type TextLayout = $ReadOnly<{|\n  ...Layout,\n  ascender: number,\n  capHeight: number,\n  descender: number,\n  text: string,\n  xHeight: number,\n|}>;\n\nexport type LayoutEvent = SyntheticEvent<\n  $ReadOnly<{|\n    layout: Layout,\n  |}>,\n>;\n\nexport type TextLayoutEvent = SyntheticEvent<\n  $ReadOnly<{|\n    lines: Array<TextLayout>,\n  |}>,\n>;\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/API/UIEvent\n */\nexport interface NativeUIEvent {\n  /**\n   * Returns a long with details about the event, depending on the event type.\n   */\n  +detail: number;\n}\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent\n */\nexport interface NativeMouseEvent extends NativeUIEvent {\n  /**\n   * The X coordinate of the mouse pointer in global (screen) coordinates.\n   */\n  +screenX: number;\n  /**\n   * The Y coordinate of the mouse pointer in global (screen) coordinates.\n   */\n  +screenY: number;\n  /**\n   * The X coordinate of the mouse pointer relative to the whole document.\n   */\n  +pageX: number;\n  /**\n   * The Y coordinate of the mouse pointer relative to the whole document.\n   */\n  +pageY: number;\n  /**\n   * The X coordinate of the mouse pointer in local (DOM content) coordinates.\n   */\n  +clientX: number;\n  /**\n   * The Y coordinate of the mouse pointer in local (DOM content) coordinates.\n   */\n  +clientY: number;\n  /**\n   * Alias for NativeMouseEvent.clientX\n   */\n  +x: number;\n  /**\n   * Alias for NativeMouseEvent.clientY\n   */\n  +y: number;\n  /**\n   * Returns true if the control key was down when the mouse event was fired.\n   */\n  +ctrlKey: boolean;\n  /**\n   * Returns true if the shift key was down when the mouse event was fired.\n   */\n  +shiftKey: boolean;\n  /**\n   * Returns true if the alt key was down when the mouse event was fired.\n   */\n  +altKey: boolean;\n  /**\n   * Returns true if the meta key was down when the mouse event was fired.\n   */\n  +metaKey: boolean;\n  /**\n   * The button number that was pressed (if applicable) when the mouse event was fired.\n   */\n  +button: number;\n  /**\n   * The buttons being depressed (if any) when the mouse event was fired.\n   */\n  +buttons: number;\n  /**\n   * The secondary target for the event, if there is one.\n   */\n  +relatedTarget: HTMLElement;\n  // offset is proposed: https://drafts.csswg.org/cssom-view/#extensions-to-the-mouseevent-interface\n  /**\n   * The X coordinate of the mouse pointer between that event and the padding edge of the target node\n   */\n  +offsetX: number;\n  /**\n   * The Y coordinate of the mouse pointer between that event and the padding edge of the target node\n   */\n  +offsetY: number;\n}\n\n/**\n * https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent\n */\nexport interface NativePointerEvent extends NativeMouseEvent {\n  /**\n   * A unique identifier for the pointer causing the event.\n   */\n  +pointerId: number;\n  /**\n   * The width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer\n   */\n  +width: number;\n  /**\n   * The height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer.\n   */\n  +height: number;\n  /**\n   * The normalized pressure of the pointer input in the range 0 to 1, where 0 and 1 represent\n   * the minimum and maximum pressure the hardware is capable of detecting, respectively.\n   */\n  +pressure: number;\n  /**\n   * The normalized tangential pressure of the pointer input (also known as barrel pressure or\n   * cylinder stress) in the range -1 to 1, where 0 is the neutral position of the control.\n   */\n  +tangentialPressure: number;\n  /**\n   * The plane angle (in degrees, in the range of -90 to 90) between the Y–Z plane and the plane\n   * containing both the pointer (e.g. pen stylus) axis and the Y axis.\n   */\n  +tiltX: number;\n  /**\n   * The plane angle (in degrees, in the range of -90 to 90) between the X–Z plane and the plane\n   * containing both the pointer (e.g. pen stylus) axis and the X axis.\n   */\n  +tiltY: number;\n  /**\n   * The clockwise rotation of the pointer (e.g. pen stylus) around its major axis in degrees,\n   * with a value in the range 0 to 359.\n   */\n  +twist: number;\n  /**\n   * Indicates the device type that caused the event (mouse, pen, touch, etc.)\n   */\n  +pointerType: string;\n  /**\n   * Indicates if the pointer represents the primary pointer of this pointer type.\n   */\n  +isPrimary: boolean;\n}\n\nexport type PointerEvent = SyntheticEvent<NativePointerEvent>;\n\nexport type PressEvent = ResponderSyntheticEvent<\n  $ReadOnly<{|\n    changedTouches: $ReadOnlyArray<$PropertyType<PressEvent, 'nativeEvent'>>,\n    force: number,\n    identifier: number,\n    locationX: number,\n    locationY: number,\n    pageX: number,\n    pageY: number,\n    target: ?HTMLElement,\n    timestamp: number,\n    touches: $ReadOnlyArray<$PropertyType<PressEvent, 'nativeEvent'>>,\n  |}>,\n>;\n\nexport type ScrollEvent = SyntheticEvent<\n  $ReadOnly<{|\n    contentInset: $ReadOnly<{|\n      bottom: number,\n      left: number,\n      right: number,\n      top: number,\n    |}>,\n    contentOffset: $ReadOnly<{|\n      y: number,\n      x: number,\n    |}>,\n    contentSize: $ReadOnly<{|\n      height: number,\n      width: number,\n    |}>,\n    layoutMeasurement: $ReadOnly<{|\n      height: number,\n      width: number,\n    |}>,\n    targetContentOffset?: $ReadOnly<{|\n      y: number,\n      x: number,\n    |}>,\n    velocity?: $ReadOnly<{|\n      y: number,\n      x: number,\n    |}>,\n    zoomScale?: number,\n    responderIgnoreScroll?: boolean,\n  |}>,\n>;\n\nexport type BlurEvent = SyntheticEvent<\n  $ReadOnly<{|\n    target: number,\n  |}>,\n>;\n\nexport type FocusEvent = SyntheticEvent<\n  $ReadOnly<{|\n    target: number,\n  |}>,\n>;\n\nexport type MouseEvent = SyntheticEvent<\n  $ReadOnly<{|\n    clientX: number,\n    clientY: number,\n    pageX: number,\n    pageY: number,\n    timestamp: number,\n  |}>,\n>;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Utilities/Platform.js",
    "content": "import Platform from '../../../exports/Platform';\nexport default Platform;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Utilities/clamp.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * @flow strict\n */\n\n'use strict';\n\nfunction clamp(min: number, value: number, max: number): number {\n  if (value < min) {\n    return min;\n  }\n  if (value > max) {\n    return max;\n  }\n  return value;\n}\n\nexport default clamp;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Utilities/setAndForwardRef.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * @flow\n */\n\n'use strict';\n\nimport type {ElementRef, Ref} from 'react';\n\ntype Args = $ReadOnly<{|\n  getForwardedRef: () => ?Ref<any>,\n  setLocalRef: (ref: ElementRef<any>) => mixed,\n|}>;\n\n/**\n * This is a helper function for when a component needs to be able to forward a ref\n * to a child component, but still needs to have access to that component as part of\n * its implementation.\n *\n * Its main use case is in wrappers for native components.\n *\n * Usage:\n *\n *   class MyView extends React.Component {\n *     _nativeRef = null;\n *\n *     _setNativeRef = setAndForwardRef({\n *       getForwardedRef: () => this.props.forwardedRef,\n *       setLocalRef: ref => {\n *         this._nativeRef = ref;\n *       },\n *     });\n *\n *     render() {\n *       return <View ref={this._setNativeRef} />;\n *     }\n *   }\n *\n *   const MyViewWithRef = React.forwardRef((props, ref) => (\n *     <MyView {...props} forwardedRef={ref} />\n *   ));\n *\n *   module.exports = MyViewWithRef;\n */\n\nfunction setAndForwardRef({\n  getForwardedRef,\n  setLocalRef,\n}: Args): (ref: ElementRef<any>) => void {\n  return function forwardRef(ref: ElementRef<any>) {\n    const forwardedRef = getForwardedRef();\n\n    setLocalRef(ref);\n\n    // Forward to user ref prop (if one has been specified)\n    if (typeof forwardedRef === 'function') {\n      // Handle function-based refs. String-based refs are handled as functions.\n      forwardedRef(ref);\n    } else if (typeof forwardedRef === 'object' && forwardedRef != null) {\n      // Handle createRef-based refs\n      forwardedRef.current = ref;\n    }\n  };\n}\n\nexport default setAndForwardRef;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Utilities/useMergeRefs.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict\n * @format\n */\n\nimport {useCallback} from 'react';\n\ntype CallbackRef<T> = T => mixed;\ntype ObjectRef<T> = {current: T, ...};\n\ntype Ref<T> = CallbackRef<T> | ObjectRef<T>;\n\n/**\n * Constructs a new ref that forwards new values to each of the given refs. The\n * given refs will always be invoked in the order that they are supplied.\n *\n * WARNING: A known problem of merging refs using this approach is that if any\n * of the given refs change, the returned callback ref will also be changed. If\n * the returned callback ref is supplied as a `ref` to a React element, this may\n * lead to problems with the given refs being invoked more times than desired.\n */\nexport default function useMergeRefs<T>(\n  ...refs: $ReadOnlyArray<?Ref<T>>\n): CallbackRef<T> {\n  return useCallback(\n    (current: T) => {\n      for (const ref of refs) {\n        if (ref != null) {\n          if (typeof ref === 'function') {\n            ref(current);\n          } else {\n            ref.current = current;\n          }\n        }\n      }\n    },\n    [...refs], // eslint-disable-line react-hooks/exhaustive-deps\n  );\n}\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/Utilities/useRefEffect.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict\n * @format\n */\n\nimport {useCallback, useRef} from 'react';\n\ntype CallbackRef<T> = T => mixed;\n\n/**\n * Constructs a callback ref that provides similar semantics as `useEffect`. The\n * supplied `effect` callback will be called with non-null component instances.\n * The `effect` callback can also optionally return a cleanup function.\n *\n * When a component is updated or unmounted, the cleanup function is called. The\n * `effect` callback will then be called again, if applicable.\n *\n * When a new `effect` callback is supplied, the previously returned cleanup\n * function will be called before the new `effect` callback is called with the\n * same instance.\n *\n * WARNING: The `effect` callback should be stable (e.g. using `useCallback`).\n */\nexport default function useRefEffect<TInstance>(\n  effect: TInstance => (() => void) | void,\n): CallbackRef<TInstance | null> {\n  const cleanupRef = useRef<(() => void) | void>(undefined);\n  return useCallback(\n    instance => {\n      if (cleanupRef.current) {\n        cleanupRef.current();\n        cleanupRef.current = undefined;\n      }\n      if (instance != null) {\n        cleanupRef.current = effect(instance);\n      }\n    },\n    [effect],\n  );\n}\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/ViewabilityHelper/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport type {FrameMetricProps} from '../VirtualizedList/VirtualizedListProps';\n\nimport invariant from 'fbjs/lib/invariant';\n\nexport type ViewToken = {\n  item: any,\n  key: string,\n  index: ?number,\n  isViewable: boolean,\n  section?: any,\n  ...\n};\n\nexport type ViewabilityConfigCallbackPair = {\n  viewabilityConfig: ViewabilityConfig,\n  onViewableItemsChanged: (info: {\n    viewableItems: Array<ViewToken>,\n    changed: Array<ViewToken>,\n    ...\n  }) => void,\n  ...\n};\n\nexport type ViewabilityConfig = {|\n  /**\n   * Minimum amount of time (in milliseconds) that an item must be physically viewable before the\n   * viewability callback will be fired. A high number means that scrolling through content without\n   * stopping will not mark the content as viewable.\n   */\n  minimumViewTime?: number,\n\n  /**\n   * Percent of viewport that must be covered for a partially occluded item to count as\n   * \"viewable\", 0-100. Fully visible items are always considered viewable. A value of 0 means\n   * that a single pixel in the viewport makes the item viewable, and a value of 100 means that\n   * an item must be either entirely visible or cover the entire viewport to count as viewable.\n   */\n  viewAreaCoveragePercentThreshold?: number,\n\n  /**\n   * Similar to `viewAreaPercentThreshold`, but considers the percent of the item that is visible,\n   * rather than the fraction of the viewable area it covers.\n   */\n  itemVisiblePercentThreshold?: number,\n\n  /**\n   * Nothing is considered viewable until the user scrolls or `recordInteraction` is called after\n   * render.\n   */\n  waitForInteraction?: boolean,\n|};\n\n/**\n * A Utility class for calculating viewable items based on current metrics like scroll position and\n * layout.\n *\n * An item is said to be in a \"viewable\" state when any of the following\n * is true for longer than `minimumViewTime` milliseconds (after an interaction if `waitForInteraction`\n * is true):\n *\n * - Occupying >= `viewAreaCoveragePercentThreshold` of the view area XOR fraction of the item\n *   visible in the view area >= `itemVisiblePercentThreshold`.\n * - Entirely visible on screen\n */\nclass ViewabilityHelper {\n  _config: ViewabilityConfig;\n  _hasInteracted: boolean = false;\n  _timers: Set<number> = new Set();\n  _viewableIndices: Array<number> = [];\n  _viewableItems: Map<string, ViewToken> = new Map();\n\n  constructor(\n    config: ViewabilityConfig = {viewAreaCoveragePercentThreshold: 0},\n  ) {\n    this._config = config;\n  }\n\n  /**\n   * Cleanup, e.g. on unmount. Clears any pending timers.\n   */\n  dispose() {\n    /* $FlowFixMe[incompatible-call] (>=0.63.0 site=react_native_fb) This\n     * comment suppresses an error found when Flow v0.63 was deployed. To see\n     * the error delete this comment and run Flow. */\n    this._timers.forEach(clearTimeout);\n  }\n\n  /**\n   * Determines which items are viewable based on the current metrics and config.\n   */\n  computeViewableItems(\n    props: FrameMetricProps,\n    scrollOffset: number,\n    viewportHeight: number,\n    getFrameMetrics: (\n      index: number,\n      props: FrameMetricProps,\n    ) => ?{\n      length: number,\n      offset: number,\n      ...\n    },\n    // Optional optimization to reduce the scan size\n    renderRange?: {\n      first: number,\n      last: number,\n      ...\n    },\n  ): Array<number> {\n    const itemCount = props.getItemCount(props.data);\n    const {itemVisiblePercentThreshold, viewAreaCoveragePercentThreshold} =\n      this._config;\n    const viewAreaMode = viewAreaCoveragePercentThreshold != null;\n    const viewablePercentThreshold = viewAreaMode\n      ? viewAreaCoveragePercentThreshold\n      : itemVisiblePercentThreshold;\n    invariant(\n      viewablePercentThreshold != null &&\n        (itemVisiblePercentThreshold != null) !==\n          (viewAreaCoveragePercentThreshold != null),\n      'Must set exactly one of itemVisiblePercentThreshold or viewAreaCoveragePercentThreshold',\n    );\n    const viewableIndices = [];\n    if (itemCount === 0) {\n      return viewableIndices;\n    }\n    let firstVisible = -1;\n    const {first, last} = renderRange || {first: 0, last: itemCount - 1};\n    if (last >= itemCount) {\n      console.warn(\n        'Invalid render range computing viewability ' +\n          JSON.stringify({renderRange, itemCount}),\n      );\n      return [];\n    }\n    for (let idx = first; idx <= last; idx++) {\n      const metrics = getFrameMetrics(idx, props);\n      if (!metrics) {\n        continue;\n      }\n      const top = metrics.offset - scrollOffset;\n      const bottom = top + metrics.length;\n      if (top < viewportHeight && bottom > 0) {\n        firstVisible = idx;\n        if (\n          _isViewable(\n            viewAreaMode,\n            viewablePercentThreshold,\n            top,\n            bottom,\n            viewportHeight,\n            metrics.length,\n          )\n        ) {\n          viewableIndices.push(idx);\n        }\n      } else if (firstVisible >= 0) {\n        break;\n      }\n    }\n    return viewableIndices;\n  }\n\n  /**\n   * Figures out which items are viewable and how that has changed from before and calls\n   * `onViewableItemsChanged` as appropriate.\n   */\n  onUpdate(\n    props: FrameMetricProps,\n    scrollOffset: number,\n    viewportHeight: number,\n    getFrameMetrics: (\n      index: number,\n      props: FrameMetricProps,\n    ) => ?{\n      length: number,\n      offset: number,\n      ...\n    },\n    createViewToken: (\n      index: number,\n      isViewable: boolean,\n      props: FrameMetricProps,\n    ) => ViewToken,\n    onViewableItemsChanged: ({\n      viewableItems: Array<ViewToken>,\n      changed: Array<ViewToken>,\n      ...\n    }) => void,\n    // Optional optimization to reduce the scan size\n    renderRange?: {\n      first: number,\n      last: number,\n      ...\n    },\n  ): void {\n    const itemCount = props.getItemCount(props.data);\n    if (\n      (this._config.waitForInteraction && !this._hasInteracted) ||\n      itemCount === 0 ||\n      !getFrameMetrics(0, props)\n    ) {\n      return;\n    }\n    let viewableIndices: Array<number> = [];\n    if (itemCount) {\n      viewableIndices = this.computeViewableItems(\n        props,\n        scrollOffset,\n        viewportHeight,\n        getFrameMetrics,\n        renderRange,\n      );\n    }\n    if (\n      this._viewableIndices.length === viewableIndices.length &&\n      this._viewableIndices.every((v, ii) => v === viewableIndices[ii])\n    ) {\n      // We might get a lot of scroll events where visibility doesn't change and we don't want to do\n      // extra work in those cases.\n      return;\n    }\n    this._viewableIndices = viewableIndices;\n    if (this._config.minimumViewTime) {\n      const handle: TimeoutID = setTimeout(() => {\n        /* $FlowFixMe[incompatible-call] (>=0.63.0 site=react_native_fb) This\n         * comment suppresses an error found when Flow v0.63 was deployed. To\n         * see the error delete this comment and run Flow. */\n        this._timers.delete(handle);\n        this._onUpdateSync(\n          props,\n          viewableIndices,\n          onViewableItemsChanged,\n          createViewToken,\n        );\n      }, this._config.minimumViewTime);\n      /* $FlowFixMe[incompatible-call] (>=0.63.0 site=react_native_fb) This\n       * comment suppresses an error found when Flow v0.63 was deployed. To see\n       * the error delete this comment and run Flow. */\n      this._timers.add(handle);\n    } else {\n      this._onUpdateSync(\n        props,\n        viewableIndices,\n        onViewableItemsChanged,\n        createViewToken,\n      );\n    }\n  }\n\n  /**\n   * clean-up cached _viewableIndices to evaluate changed items on next update\n   */\n  resetViewableIndices() {\n    this._viewableIndices = [];\n  }\n\n  /**\n   * Records that an interaction has happened even if there has been no scroll.\n   */\n  recordInteraction() {\n    this._hasInteracted = true;\n  }\n\n  _onUpdateSync(\n    props: FrameMetricProps,\n    viewableIndicesToCheck: Array<number>,\n    onViewableItemsChanged: ({\n      changed: Array<ViewToken>,\n      viewableItems: Array<ViewToken>,\n      ...\n    }) => void,\n    createViewToken: (\n      index: number,\n      isViewable: boolean,\n      props: FrameMetricProps,\n    ) => ViewToken,\n  ) {\n    // Filter out indices that have gone out of view since this call was scheduled.\n    viewableIndicesToCheck = viewableIndicesToCheck.filter(ii =>\n      this._viewableIndices.includes(ii),\n    );\n    const prevItems = this._viewableItems;\n    const nextItems = new Map(\n      viewableIndicesToCheck.map(ii => {\n        const viewable = createViewToken(ii, true, props);\n        return [viewable.key, viewable];\n      }),\n    );\n\n    const changed = [];\n    for (const [key, viewable] of nextItems) {\n      if (!prevItems.has(key)) {\n        changed.push(viewable);\n      }\n    }\n    for (const [key, viewable] of prevItems) {\n      if (!nextItems.has(key)) {\n        changed.push({...viewable, isViewable: false});\n      }\n    }\n    if (changed.length > 0) {\n      this._viewableItems = nextItems;\n      onViewableItemsChanged({\n        viewableItems: Array.from(nextItems.values()),\n        changed,\n        viewabilityConfig: this._config,\n      });\n    }\n  }\n}\n\nfunction _isViewable(\n  viewAreaMode: boolean,\n  viewablePercentThreshold: number,\n  top: number,\n  bottom: number,\n  viewportHeight: number,\n  itemLength: number,\n): boolean {\n  if (_isEntirelyVisible(top, bottom, viewportHeight)) {\n    return true;\n  } else {\n    const pixels = _getPixelsVisible(top, bottom, viewportHeight);\n    const percent =\n      100 * (viewAreaMode ? pixels / viewportHeight : pixels / itemLength);\n    return percent >= viewablePercentThreshold;\n  }\n}\n\nfunction _getPixelsVisible(\n  top: number,\n  bottom: number,\n  viewportHeight: number,\n): number {\n  const visibleHeight = Math.min(bottom, viewportHeight) - Math.max(top, 0);\n  return Math.max(0, visibleHeight);\n}\n\nfunction _isEntirelyVisible(\n  top: number,\n  bottom: number,\n  viewportHeight: number,\n): boolean {\n  return top >= 0 && bottom <= viewportHeight && bottom > top;\n}\n\nexport default ViewabilityHelper;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/VirtualizeUtils/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\n'use strict';\n\nimport type {FrameMetricProps} from '../VirtualizedList/VirtualizedListProps';\n\n/**\n * Used to find the indices of the frames that overlap the given offsets. Useful for finding the\n * items that bound different windows of content, such as the visible area or the buffered overscan\n * area.\n */\nexport function elementsThatOverlapOffsets(\n  offsets: Array<number>,\n  props: FrameMetricProps,\n  getFrameMetrics: (\n    index: number,\n    props: FrameMetricProps,\n  ) => {\n    length: number,\n    offset: number,\n    ...\n  },\n  zoomScale: number = 1,\n): Array<number> {\n  const itemCount = props.getItemCount(props.data);\n  const result = [];\n  for (let offsetIndex = 0; offsetIndex < offsets.length; offsetIndex++) {\n    const currentOffset = offsets[offsetIndex];\n    let left = 0;\n    let right = itemCount - 1;\n\n    while (left <= right) {\n      // eslint-disable-next-line no-bitwise\n      const mid = left + ((right - left) >>> 1);\n      const frame = getFrameMetrics(mid, props);\n      const scaledOffsetStart = frame.offset * zoomScale;\n      const scaledOffsetEnd = (frame.offset + frame.length) * zoomScale;\n\n      // We want the first frame that contains the offset, with inclusive bounds. Thus, for the\n      // first frame the scaledOffsetStart is inclusive, while for other frames it is exclusive.\n      if (\n        (mid === 0 && currentOffset < scaledOffsetStart) ||\n        (mid !== 0 && currentOffset <= scaledOffsetStart)\n      ) {\n        right = mid - 1;\n      } else if (currentOffset > scaledOffsetEnd) {\n        left = mid + 1;\n      } else {\n        result[offsetIndex] = mid;\n        break;\n      }\n    }\n  }\n\n  return result;\n}\n\n/**\n * Computes the number of elements in the `next` range that are new compared to the `prev` range.\n * Handy for calculating how many new items will be rendered when the render window changes so we\n * can restrict the number of new items render at once so that content can appear on the screen\n * faster.\n */\nexport function newRangeCount(\n  prev: {\n    first: number,\n    last: number,\n    ...\n  },\n  next: {\n    first: number,\n    last: number,\n    ...\n  },\n): number {\n  return (\n    next.last -\n    next.first +\n    1 -\n    Math.max(\n      0,\n      1 + Math.min(next.last, prev.last) - Math.max(next.first, prev.first),\n    )\n  );\n}\n\n/**\n * Custom logic for determining which items should be rendered given the current frame and scroll\n * metrics, as well as the previous render state. The algorithm may evolve over time, but generally\n * prioritizes the visible area first, then expands that with overscan regions ahead and behind,\n * biased in the direction of scroll.\n */\nexport function computeWindowedRenderLimits(\n  props: FrameMetricProps,\n  maxToRenderPerBatch: number,\n  windowSize: number,\n  prev: {\n    first: number,\n    last: number,\n  },\n  getFrameMetricsApprox: (\n    index: number,\n    props: FrameMetricProps,\n  ) => {\n    length: number,\n    offset: number,\n    ...\n  },\n  scrollMetrics: {\n    dt: number,\n    offset: number,\n    velocity: number,\n    visibleLength: number,\n    zoomScale: number,\n    ...\n  },\n): {\n  first: number,\n  last: number,\n} {\n  const itemCount = props.getItemCount(props.data);\n  if (itemCount === 0) {\n    return {first: 0, last: -1};\n  }\n  const {offset, velocity, visibleLength, zoomScale = 1} = scrollMetrics;\n\n  // Start with visible area, then compute maximum overscan region by expanding from there, biased\n  // in the direction of scroll. Total overscan area is capped, which should cap memory consumption\n  // too.\n  const visibleBegin = Math.max(0, offset);\n  const visibleEnd = visibleBegin + visibleLength;\n  const overscanLength = (windowSize - 1) * visibleLength;\n\n  // Considering velocity seems to introduce more churn than it's worth.\n  const leadFactor = 0.5; // Math.max(0, Math.min(1, velocity / 25 + 0.5));\n\n  const fillPreference =\n    velocity > 1 ? 'after' : velocity < -1 ? 'before' : 'none';\n\n  const overscanBegin = Math.max(\n    0,\n    visibleBegin - (1 - leadFactor) * overscanLength,\n  );\n  const overscanEnd = Math.max(0, visibleEnd + leadFactor * overscanLength);\n\n  const lastItemOffset =\n    getFrameMetricsApprox(itemCount - 1, props).offset * zoomScale;\n  if (lastItemOffset < overscanBegin) {\n    // Entire list is before our overscan window\n    return {\n      first: Math.max(0, itemCount - 1 - maxToRenderPerBatch),\n      last: itemCount - 1,\n    };\n  }\n\n  // Find the indices that correspond to the items at the render boundaries we're targeting.\n  let [overscanFirst, first, last, overscanLast] = elementsThatOverlapOffsets(\n    [overscanBegin, visibleBegin, visibleEnd, overscanEnd],\n    props,\n    getFrameMetricsApprox,\n    zoomScale,\n  );\n  overscanFirst = overscanFirst == null ? 0 : overscanFirst;\n  first = first == null ? Math.max(0, overscanFirst) : first;\n  overscanLast = overscanLast == null ? itemCount - 1 : overscanLast;\n  last =\n    last == null\n      ? Math.min(overscanLast, first + maxToRenderPerBatch - 1)\n      : last;\n  const visible = {first, last};\n\n  // We want to limit the number of new cells we're rendering per batch so that we can fill the\n  // content on the screen quickly. If we rendered the entire overscan window at once, the user\n  // could be staring at white space for a long time waiting for a bunch of offscreen content to\n  // render.\n  let newCellCount = newRangeCount(prev, visible);\n\n  while (true) {\n    if (first <= overscanFirst && last >= overscanLast) {\n      // If we fill the entire overscan range, we're done.\n      break;\n    }\n    const maxNewCells = newCellCount >= maxToRenderPerBatch;\n    const firstWillAddMore = first <= prev.first || first > prev.last;\n    const firstShouldIncrement =\n      first > overscanFirst && (!maxNewCells || !firstWillAddMore);\n    const lastWillAddMore = last >= prev.last || last < prev.first;\n    const lastShouldIncrement =\n      last < overscanLast && (!maxNewCells || !lastWillAddMore);\n    if (maxNewCells && !firstShouldIncrement && !lastShouldIncrement) {\n      // We only want to stop if we've hit maxNewCells AND we cannot increment first or last\n      // without rendering new items. This let's us preserve as many already rendered items as\n      // possible, reducing render churn and keeping the rendered overscan range as large as\n      // possible.\n      break;\n    }\n    if (\n      firstShouldIncrement &&\n      !(fillPreference === 'after' && lastShouldIncrement && lastWillAddMore)\n    ) {\n      if (firstWillAddMore) {\n        newCellCount++;\n      }\n      first--;\n    }\n    if (\n      lastShouldIncrement &&\n      !(fillPreference === 'before' && firstShouldIncrement && firstWillAddMore)\n    ) {\n      if (lastWillAddMore) {\n        newCellCount++;\n      }\n      last++;\n    }\n  }\n  if (\n    !(\n      last >= first &&\n      first >= 0 &&\n      last < itemCount &&\n      first >= overscanFirst &&\n      last <= overscanLast &&\n      first <= visible.first &&\n      last >= visible.last\n    )\n  ) {\n    throw new Error(\n      'Bad window calculation ' +\n        JSON.stringify({\n          first,\n          last,\n          itemCount,\n          overscanFirst,\n          overscanLast,\n          visible,\n        }),\n    );\n  }\n  return {first, last};\n}\n\nexport function keyExtractor(item: any, index: number): string {\n  if (typeof item === 'object' && item?.key != null) {\n    return item.key;\n  }\n  if (typeof item === 'object' && item?.id != null) {\n    return item.id;\n  }\n  return String(index);\n}\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/VirtualizedList/CellRenderMask.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict\n * @format\n */\n\nimport invariant from 'fbjs/lib/invariant';\n\nexport type CellRegion = {\n  first: number,\n  last: number,\n  isSpacer: boolean,\n};\n\nexport class CellRenderMask {\n  _numCells: number;\n  _regions: Array<CellRegion>;\n\n  constructor(numCells: number) {\n    invariant(\n      numCells >= 0,\n      'CellRenderMask must contain a non-negative number os cells',\n    );\n\n    this._numCells = numCells;\n\n    if (numCells === 0) {\n      this._regions = [];\n    } else {\n      this._regions = [\n        {\n          first: 0,\n          last: numCells - 1,\n          isSpacer: true,\n        },\n      ];\n    }\n  }\n\n  enumerateRegions(): $ReadOnlyArray<CellRegion> {\n    return this._regions;\n  }\n\n  addCells(cells: {first: number, last: number}): void {\n    invariant(\n      cells.first >= 0 &&\n        cells.first < this._numCells &&\n        cells.last >= -1 &&\n        cells.last < this._numCells &&\n        cells.last >= cells.first - 1,\n      'CellRenderMask.addCells called with invalid cell range',\n    );\n\n    // VirtualizedList uses inclusive ranges, where zero-count states are\n    // possible. E.g. [0, -1] for no cells, starting at 0.\n    if (cells.last < cells.first) {\n      return;\n    }\n\n    const [firstIntersect, firstIntersectIdx] = this._findRegion(cells.first);\n    const [lastIntersect, lastIntersectIdx] = this._findRegion(cells.last);\n\n    // Fast-path if the cells to add are already all present in the mask. We\n    // will otherwise need to do some mutation.\n    if (firstIntersectIdx === lastIntersectIdx && !firstIntersect.isSpacer) {\n      return;\n    }\n\n    // We need to replace the existing covered regions with 1-3 new regions\n    // depending whether we need to split spacers out of overlapping regions.\n    const newLeadRegion: Array<CellRegion> = [];\n    const newTailRegion: Array<CellRegion> = [];\n    const newMainRegion: CellRegion = {\n      ...cells,\n      isSpacer: false,\n    };\n\n    if (firstIntersect.first < newMainRegion.first) {\n      if (firstIntersect.isSpacer) {\n        newLeadRegion.push({\n          first: firstIntersect.first,\n          last: newMainRegion.first - 1,\n          isSpacer: true,\n        });\n      } else {\n        newMainRegion.first = firstIntersect.first;\n      }\n    }\n\n    if (lastIntersect.last > newMainRegion.last) {\n      if (lastIntersect.isSpacer) {\n        newTailRegion.push({\n          first: newMainRegion.last + 1,\n          last: lastIntersect.last,\n          isSpacer: true,\n        });\n      } else {\n        newMainRegion.last = lastIntersect.last;\n      }\n    }\n\n    const replacementRegions: Array<CellRegion> = [\n      ...newLeadRegion,\n      newMainRegion,\n      ...newTailRegion,\n    ];\n    const numRegionsToDelete = lastIntersectIdx - firstIntersectIdx + 1;\n    this._regions.splice(\n      firstIntersectIdx,\n      numRegionsToDelete,\n      ...replacementRegions,\n    );\n  }\n\n  numCells(): number {\n    return this._numCells;\n  }\n\n  equals(other: CellRenderMask): boolean {\n    return (\n      this._numCells === other._numCells &&\n      this._regions.length === other._regions.length &&\n      this._regions.every(\n        (region, i) =>\n          region.first === other._regions[i].first &&\n          region.last === other._regions[i].last &&\n          region.isSpacer === other._regions[i].isSpacer,\n      )\n    );\n  }\n\n  _findRegion(cellIdx: number): [CellRegion, number] {\n    let firstIdx = 0;\n    let lastIdx = this._regions.length - 1;\n\n    while (firstIdx <= lastIdx) {\n      const middleIdx = Math.floor((firstIdx + lastIdx) / 2);\n      const middleRegion = this._regions[middleIdx];\n\n      if (cellIdx >= middleRegion.first && cellIdx <= middleRegion.last) {\n        return [middleRegion, middleIdx];\n      } else if (cellIdx < middleRegion.first) {\n        lastIdx = middleIdx - 1;\n      } else if (cellIdx > middleRegion.last) {\n        firstIdx = middleIdx + 1;\n      }\n    }\n\n    invariant(false, `A region was not found containing cellIdx ${cellIdx}`);\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/VirtualizedList/ChildListCollection.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict\n * @format\n */\n\nimport invariant from 'fbjs/lib/invariant';\n\nexport default class ChildListCollection<TList> {\n  _cellKeyToChildren: Map<string, Set<TList>> = new Map();\n  _childrenToCellKey: Map<TList, string> = new Map();\n\n  add(list: TList, cellKey: string): void {\n    invariant(\n      !this._childrenToCellKey.has(list),\n      'Trying to add already present child list',\n    );\n\n    const cellLists = this._cellKeyToChildren.get(cellKey) ?? new Set();\n    cellLists.add(list);\n    this._cellKeyToChildren.set(cellKey, cellLists);\n\n    this._childrenToCellKey.set(list, cellKey);\n  }\n\n  remove(list: TList): void {\n    const cellKey = this._childrenToCellKey.get(list);\n    invariant(cellKey != null, 'Trying to remove non-present child list');\n    this._childrenToCellKey.delete(list);\n\n    const cellLists = this._cellKeyToChildren.get(cellKey);\n    invariant(cellLists, '_cellKeyToChildren should contain cellKey');\n    cellLists.delete(list);\n\n    if (cellLists.size === 0) {\n      this._cellKeyToChildren.delete(cellKey);\n    }\n  }\n\n  forEach(fn: TList => void): void {\n    for (const listSet of this._cellKeyToChildren.values()) {\n      for (const list of listSet) {\n        fn(list);\n      }\n    }\n  }\n\n  forEachInCell(cellKey: string, fn: TList => void): void {\n    const listSet = this._cellKeyToChildren.get(cellKey) ?? [];\n    for (const list of listSet) {\n      fn(list);\n    }\n  }\n\n  anyInCell(cellKey: string, fn: TList => boolean): boolean {\n    const listSet = this._cellKeyToChildren.get(cellKey) ?? [];\n    for (const list of listSet) {\n      if (fn(list)) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  size(): number {\n    return this._childrenToCellKey.size;\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/VirtualizedList/StateSafePureComponent.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict\n * @format\n */\n\nimport invariant from 'fbjs/lib/invariant';\nimport * as React from 'react';\n\n/**\n * `setState` is called asynchronously, and should not rely on the value of\n * `this.props` or `this.state`:\n * https://reactjs.org/docs/state-and-lifecycle.html#state-updates-may-be-asynchronous\n *\n * SafePureComponent adds runtime enforcement, to catch cases where these\n * variables are read in a state updater function, instead of the ones passed\n * in.\n */\nexport default class StateSafePureComponent<\n  Props,\n  State: interface {},\n> extends React.PureComponent<Props, State> {\n  _inAsyncStateUpdate = false;\n\n  constructor(props: Props) {\n    super(props);\n    this._installSetStateHooks();\n  }\n\n  setState(\n    partialState: ?($Shape<State> | ((State, Props) => ?$Shape<State>)),\n    callback?: () => mixed,\n  ): void {\n    if (typeof partialState === 'function') {\n      super.setState((state, props) => {\n        this._inAsyncStateUpdate = true;\n        let ret;\n        try {\n          ret = partialState(state, props);\n        } catch (err) {\n          throw err;\n        } finally {\n          this._inAsyncStateUpdate = false;\n        }\n        return ret;\n      }, callback);\n    } else {\n      super.setState(partialState, callback);\n    }\n  }\n\n  _installSetStateHooks() {\n    const that = this;\n    let {props, state} = this;\n\n    Object.defineProperty(this, 'props', {\n      get() {\n        invariant(\n          !that._inAsyncStateUpdate,\n          '\"this.props\" should not be accessed during state updates',\n        );\n        return props;\n      },\n      set(newProps: Props) {\n        props = newProps;\n      },\n    });\n    Object.defineProperty(this, 'state', {\n      get() {\n        invariant(\n          !that._inAsyncStateUpdate,\n          '\"this.state\" should not be acceessed during state updates',\n        );\n        return state;\n      },\n      set(newState: State) {\n        state = newState;\n      },\n    });\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\nimport type { LayoutEvent } from '../../../types';\nimport type {\n  FocusEvent,\n} from '../Types/CoreEventTypes';\nimport type {CellRendererProps, RenderItemType} from './VirtualizedListProps';\n\nimport View, { type ViewProps } from '../../../exports/View';\nimport StyleSheet from '../../../exports/StyleSheet';\nimport {VirtualizedListCellContextProvider} from './VirtualizedListContext.js';\nimport invariant from 'fbjs/lib/invariant';\nimport * as React from 'react';\n\ntype ViewStyleProp = $PropertyType<ViewProps, 'style'>;\n\nexport type Props<ItemT> = {\n  CellRendererComponent?: ?React.ComponentType<CellRendererProps<ItemT>>,\n  ItemSeparatorComponent: ?React.ComponentType<\n    any | {highlighted: boolean, leadingItem: ?ItemT},\n  >,\n  ListItemComponent?: ?(React.ComponentType<any> | React.Element<any>),\n  cellKey: string,\n  horizontal: ?boolean,\n  index: number,\n  inversionStyle: ViewStyleProp,\n  item: ItemT,\n  onCellLayout?: (event: LayoutEvent, cellKey: string, index: number) => void,\n  onCellFocusCapture?: (event: FocusEvent) => void,\n  onUnmount: (cellKey: string) => void,\n  onUpdateSeparators: (\n    cellKeys: Array<?string>,\n    props: $Shape<SeparatorProps<ItemT>>,\n  ) => void,\n  prevCellKey: ?string,\n  renderItem?: ?RenderItemType<ItemT>,\n  ...\n};\n\ntype SeparatorProps<ItemT> = $ReadOnly<{|\n  highlighted: boolean,\n  leadingItem: ?ItemT,\n|}>;\n\ntype State<ItemT> = {\n  separatorProps: SeparatorProps<ItemT>,\n  ...\n};\n\nexport default class CellRenderer<ItemT> extends React.Component<\n  Props<ItemT>,\n  State<ItemT>,\n> {\n  state: State<ItemT> = {\n    separatorProps: {\n      highlighted: false,\n      leadingItem: this.props.item,\n    },\n  };\n\n  static getDerivedStateFromProps(\n    props: Props<ItemT>,\n    prevState: State<ItemT>,\n  ): ?State<ItemT> {\n    return {\n      separatorProps: {\n        ...prevState.separatorProps,\n        leadingItem: props.item,\n      },\n    };\n  }\n\n  // TODO: consider factoring separator stuff out of VirtualizedList into FlatList since it's not\n  // reused by SectionList and we can keep VirtualizedList simpler.\n  // $FlowFixMe[missing-local-annot]\n  _separators = {\n    highlight: () => {\n      const {cellKey, prevCellKey} = this.props;\n      this.props.onUpdateSeparators([cellKey, prevCellKey], {\n        highlighted: true,\n      });\n    },\n    unhighlight: () => {\n      const {cellKey, prevCellKey} = this.props;\n      this.props.onUpdateSeparators([cellKey, prevCellKey], {\n        highlighted: false,\n      });\n    },\n    updateProps: (\n      select: 'leading' | 'trailing',\n      newProps: SeparatorProps<ItemT>,\n    ) => {\n      const {cellKey, prevCellKey} = this.props;\n      this.props.onUpdateSeparators(\n        [select === 'leading' ? prevCellKey : cellKey],\n        newProps,\n      );\n    },\n  };\n\n  updateSeparatorProps(newProps: SeparatorProps<ItemT>) {\n    this.setState(state => ({\n      separatorProps: {...state.separatorProps, ...newProps},\n    }));\n  }\n\n  componentWillUnmount() {\n    this.props.onUnmount(this.props.cellKey);\n  }\n\n  _onLayout = (nativeEvent: LayoutEvent): void => {\n    this.props.onCellLayout &&\n      this.props.onCellLayout(\n        nativeEvent,\n        this.props.cellKey,\n        this.props.index,\n      );\n  };\n\n  _renderElement(\n    renderItem: ?RenderItemType<ItemT>,\n    ListItemComponent: any,\n    item: ItemT,\n    index: number,\n  ): React.Node {\n    if (renderItem && ListItemComponent) {\n      console.warn(\n        'VirtualizedList: Both ListItemComponent and renderItem props are present. ListItemComponent will take' +\n          ' precedence over renderItem.',\n      );\n    }\n\n    if (ListItemComponent) {\n      /* $FlowFixMe[not-a-component] (>=0.108.0 site=react_native_fb) This\n       * comment suppresses an error found when Flow v0.108 was deployed. To\n       * see the error, delete this comment and run Flow. */\n      /* $FlowFixMe[incompatible-type-arg] (>=0.108.0 site=react_native_fb)\n       * This comment suppresses an error found when Flow v0.108 was deployed.\n       * To see the error, delete this comment and run Flow. */\n      return React.createElement(ListItemComponent, {\n        item,\n        index,\n        separators: this._separators,\n      });\n    }\n\n    if (renderItem) {\n      return renderItem({\n        item,\n        index,\n        separators: this._separators,\n      });\n    }\n\n    invariant(\n      false,\n      'VirtualizedList: Either ListItemComponent or renderItem props are required but none were found.',\n    );\n  }\n\n  render(): React.Node {\n    const {\n      CellRendererComponent,\n      ItemSeparatorComponent,\n      ListItemComponent,\n      cellKey,\n      horizontal,\n      item,\n      index,\n      inversionStyle,\n      onCellFocusCapture,\n      onCellLayout,\n      renderItem,\n    } = this.props;\n    const element = this._renderElement(\n      renderItem,\n      ListItemComponent,\n      item,\n      index,\n    );\n\n    // NOTE: that when this is a sticky header, `onLayout` will get automatically extracted and\n    // called explicitly by `ScrollViewStickyHeader`.\n    const itemSeparator: React.Node = React.isValidElement(\n      ItemSeparatorComponent,\n    )\n      ? // $FlowFixMe[incompatible-type]\n        ItemSeparatorComponent\n      : // $FlowFixMe[incompatible-type]\n        ItemSeparatorComponent && (\n          <ItemSeparatorComponent {...this.state.separatorProps} />\n        );\n    const cellStyle = inversionStyle\n      ? horizontal\n        ? [styles.rowReverse, inversionStyle]\n        : [styles.columnReverse, inversionStyle]\n      : horizontal\n      ? [styles.row, inversionStyle]\n      : inversionStyle;\n    const result = !CellRendererComponent ? (\n      <View\n        style={cellStyle}\n        onFocusCapture={onCellFocusCapture}\n        {...(onCellLayout && {onLayout: this._onLayout})}>\n        {element}\n        {itemSeparator}\n      </View>\n    ) : (\n      <CellRendererComponent\n        cellKey={cellKey}\n        index={index}\n        item={item}\n        style={cellStyle}\n        onFocusCapture={onCellFocusCapture}\n        {...(onCellLayout && {onLayout: this._onLayout})}>\n        {element}\n        {itemSeparator}\n      </CellRendererComponent>\n    );\n\n    return (\n      <VirtualizedListCellContextProvider cellKey={this.props.cellKey}>\n        {result}\n      </VirtualizedListCellContextProvider>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  row: {\n    flexDirection: 'row',\n  },\n  rowReverse: {\n    flexDirection: 'row-reverse',\n  },\n  columnReverse: {\n    flexDirection: 'column-reverse',\n  },\n});\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/VirtualizedList/VirtualizedListContext.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict-local\n * @format\n */\n\nimport typeof VirtualizedList from '../VirtualizedList';\n\nimport * as React from 'react';\nimport {useContext, useMemo} from 'react';\n\nconst __DEV__ = process.env.NODE_ENV !== 'production';\n\ntype Context = $ReadOnly<{\n  cellKey: ?string,\n  getScrollMetrics: () => {\n    contentLength: number,\n    dOffset: number,\n    dt: number,\n    offset: number,\n    timestamp: number,\n    velocity: number,\n    visibleLength: number,\n    zoomScale: number,\n  },\n  horizontal: ?boolean,\n  getOutermostParentListRef: () => React.ElementRef<VirtualizedList>,\n  registerAsNestedChild: ({\n    cellKey: string,\n    ref: React.ElementRef<VirtualizedList>,\n  }) => void,\n  unregisterAsNestedChild: ({\n    ref: React.ElementRef<VirtualizedList>,\n  }) => void,\n}>;\n\nexport const VirtualizedListContext: React.Context<?Context> =\n  React.createContext(null);\nif (__DEV__) {\n  VirtualizedListContext.displayName = 'VirtualizedListContext';\n}\n\n/**\n * Resets the context. Intended for use by portal-like components (e.g. Modal).\n */\nexport function VirtualizedListContextResetter({\n  children,\n}: {\n  children: React.Node,\n}): React.Node {\n  return (\n    <VirtualizedListContext.Provider value={null}>\n      {children}\n    </VirtualizedListContext.Provider>\n  );\n}\n\n/**\n * Sets the context with memoization. Intended to be used by `VirtualizedList`.\n */\nexport function VirtualizedListContextProvider({\n  children,\n  value,\n}: {\n  children: React.Node,\n  value: Context,\n}): React.Node {\n  // Avoid setting a newly created context object if the values are identical.\n  const context = useMemo(\n    () => ({\n      cellKey: null,\n      getScrollMetrics: value.getScrollMetrics,\n      horizontal: value.horizontal,\n      getOutermostParentListRef: value.getOutermostParentListRef,\n      registerAsNestedChild: value.registerAsNestedChild,\n      unregisterAsNestedChild: value.unregisterAsNestedChild,\n    }),\n    [\n      value.getScrollMetrics,\n      value.horizontal,\n      value.getOutermostParentListRef,\n      value.registerAsNestedChild,\n      value.unregisterAsNestedChild,\n    ],\n  );\n  return (\n    <VirtualizedListContext.Provider value={context}>\n      {children}\n    </VirtualizedListContext.Provider>\n  );\n}\n\n/**\n * Sets the `cellKey`. Intended to be used by `VirtualizedList` for each cell.\n */\nexport function VirtualizedListCellContextProvider({\n  cellKey,\n  children,\n}: {\n  cellKey: string,\n  children: React.Node,\n}): React.Node {\n  // Avoid setting a newly created context object if the values are identical.\n  const currContext = useContext(VirtualizedListContext);\n  const context = useMemo(\n    () => (currContext == null ? null : {...currContext, cellKey}),\n    [currContext, cellKey],\n  );\n  return (\n    <VirtualizedListContext.Provider value={context}>\n      {children}\n    </VirtualizedListContext.Provider>\n  );\n}\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/VirtualizedList/VirtualizedListProps.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\nimport ScrollView from '../../../exports/ScrollView';\nimport type { LayoutEvent } from '../../../types';\nimport type {\n  FocusEvent,\n} from '../Types/CoreEventTypes';\nimport { type ViewProps } from '../../../exports/View';\ntype ViewStyleProp = $PropertyType<ViewProps, 'style'>;\nimport type {\n  ViewabilityConfig,\n  ViewabilityConfigCallbackPair,\n  ViewToken,\n} from '../ViewabilityHelper';\n\nimport * as React from 'react';\n\nexport type Item = any;\n\nexport type Separators = {\n  highlight: () => void,\n  unhighlight: () => void,\n  updateProps: (select: 'leading' | 'trailing', newProps: Object) => void,\n  ...\n};\n\nexport type RenderItemProps<ItemT> = {\n  item: ItemT,\n  index: number,\n  separators: Separators,\n  ...\n};\n\nexport type CellRendererProps<ItemT> = $ReadOnly<{\n  cellKey: string,\n  children: React.Node,\n  index: number,\n  item: ItemT,\n  onFocusCapture?: (event: FocusEvent) => void,\n  onLayout?: (event: LayoutEvent) => void,\n  style: ViewStyleProp,\n}>;\n\nexport type RenderItemType<ItemT> = (\n  info: RenderItemProps<ItemT>,\n) => React.Node;\n\ntype RequiredProps = {|\n  /**\n   * The default accessor functions assume this is an Array<{key: string} | {id: string}> but you can override\n   * getItem, getItemCount, and keyExtractor to handle any type of index-based data.\n   */\n  data?: any,\n  /**\n   * A generic accessor for extracting an item from any sort of data blob.\n   */\n  getItem: (data: any, index: number) => ?Item,\n  /**\n   * Determines how many items are in the data blob.\n   */\n  getItemCount: (data: any) => number,\n|};\ntype OptionalProps = {|\n  renderItem?: ?RenderItemType<Item>,\n  /**\n   * `debug` will turn on extra logging and visual overlays to aid with debugging both usage and\n   * implementation, but with a significant perf hit.\n   */\n  debug?: ?boolean,\n  /**\n   * DEPRECATED: Virtualization provides significant performance and memory optimizations, but fully\n   * unmounts react instances that are outside of the render window. You should only need to disable\n   * this for debugging purposes. Defaults to false.\n   */\n  disableVirtualization?: ?boolean,\n  /**\n   * A marker property for telling the list to re-render (since it implements `PureComponent`). If\n   * any of your `renderItem`, Header, Footer, etc. functions depend on anything outside of the\n   * `data` prop, stick it here and treat it immutably.\n   */\n  extraData?: any,\n  // e.g. height, y\n  getItemLayout?: (\n    data: any,\n    index: number,\n  ) => {\n    length: number,\n    offset: number,\n    index: number,\n    ...\n  },\n  horizontal?: ?boolean,\n  /**\n   * How many items to render in the initial batch. This should be enough to fill the screen but not\n   * much more. Note these items will never be unmounted as part of the windowed rendering in order\n   * to improve perceived performance of scroll-to-top actions.\n   */\n  initialNumToRender?: ?number,\n  /**\n   * Instead of starting at the top with the first item, start at `initialScrollIndex`. This\n   * disables the \"scroll to top\" optimization that keeps the first `initialNumToRender` items\n   * always rendered and immediately renders the items starting at this initial index. Requires\n   * `getItemLayout` to be implemented.\n   */\n  initialScrollIndex?: ?number,\n  /**\n   * Reverses the direction of scroll. Uses scale transforms of -1.\n   */\n  inverted?: ?boolean,\n  keyExtractor?: ?(item: Item, index: number) => string,\n  /**\n   * CellRendererComponent allows customizing how cells rendered by\n   * `renderItem`/`ListItemComponent` are wrapped when placed into the\n   * underlying ScrollView. This component must accept event handlers which\n   * notify VirtualizedList of changes within the cell.\n   */\n  CellRendererComponent?: ?React.ComponentType<CellRendererProps<Item>>,\n  /**\n   * Rendered in between each item, but not at the top or bottom. By default, `highlighted` and\n   * `leadingItem` props are provided. `renderItem` provides `separators.highlight`/`unhighlight`\n   * which will update the `highlighted` prop, but you can also add custom props with\n   * `separators.updateProps`.\n   */\n  ItemSeparatorComponent?: ?React.ComponentType<any>,\n  /**\n   * Takes an item from `data` and renders it into the list. Example usage:\n   *\n   *     <FlatList\n   *       ItemSeparatorComponent={Platform.OS !== 'android' && ({highlighted}) => (\n   *         <View style={[style.separator, highlighted && {marginLeft: 0}]} />\n   *       )}\n   *       data={[{title: 'Title Text', key: 'item1'}]}\n   *       ListItemComponent={({item, separators}) => (\n   *         <TouchableHighlight\n   *           onPress={() => this._onPress(item)}\n   *           onShowUnderlay={separators.highlight}\n   *           onHideUnderlay={separators.unhighlight}>\n   *           <View style={{backgroundColor: 'white'}}>\n   *             <Text>{item.title}</Text>\n   *           </View>\n   *         </TouchableHighlight>\n   *       )}\n   *     />\n   *\n   * Provides additional metadata like `index` if you need it, as well as a more generic\n   * `separators.updateProps` function which let's you set whatever props you want to change the\n   * rendering of either the leading separator or trailing separator in case the more common\n   * `highlight` and `unhighlight` (which set the `highlighted: boolean` prop) are insufficient for\n   * your use-case.\n   */\n  ListItemComponent?: ?(React.ComponentType<any> | React.Element<any>),\n  /**\n   * Rendered when the list is empty. Can be a React Component Class, a render function, or\n   * a rendered element.\n   */\n  ListEmptyComponent?: ?(React.ComponentType<any> | React.Element<any>),\n  /**\n   * Rendered at the bottom of all the items. Can be a React Component Class, a render function, or\n   * a rendered element.\n   */\n  ListFooterComponent?: ?(React.ComponentType<any> | React.Element<any>),\n  /**\n   * Styling for internal View for ListFooterComponent\n   */\n  ListFooterComponentStyle?: ViewStyleProp,\n  /**\n   * Rendered at the top of all the items. Can be a React Component Class, a render function, or\n   * a rendered element.\n   */\n  ListHeaderComponent?: ?(React.ComponentType<any> | React.Element<any>),\n  /**\n   * Styling for internal View for ListHeaderComponent\n   */\n  ListHeaderComponentStyle?: ViewStyleProp,\n  /**\n   * The maximum number of items to render in each incremental render batch. The more rendered at\n   * once, the better the fill rate, but responsiveness may suffer because rendering content may\n   * interfere with responding to button taps or other interactions.\n   */\n  maxToRenderPerBatch?: ?number,\n  /**\n   * Called once when the scroll position gets within within `onEndReachedThreshold`\n   * from the logical end of the list.\n   */\n  onEndReached?: ?(info: {distanceFromEnd: number, ...}) => void,\n  /**\n   * How far from the end (in units of visible length of the list) the trailing edge of the\n   * list must be from the end of the content to trigger the `onEndReached` callback.\n   * Thus, a value of 0.5 will trigger `onEndReached` when the end of the content is\n   * within half the visible length of the list.\n   */\n  onEndReachedThreshold?: ?number,\n  /**\n   * If provided, a standard RefreshControl will be added for \"Pull to Refresh\" functionality. Make\n   * sure to also set the `refreshing` prop correctly.\n   */\n  onRefresh?: ?() => void,\n  /**\n   * Used to handle failures when scrolling to an index that has not been measured yet. Recommended\n   * action is to either compute your own offset and `scrollTo` it, or scroll as far as possible and\n   * then try again after more items have been rendered.\n   */\n  onScrollToIndexFailed?: ?(info: {\n    index: number,\n    highestMeasuredFrameIndex: number,\n    averageItemLength: number,\n    ...\n  }) => void,\n  /**\n   * Called once when the scroll position gets within within `onStartReachedThreshold`\n   * from the logical start of the list.\n   */\n  onStartReached?: ?(info: {distanceFromStart: number, ...}) => void,\n  /**\n   * How far from the start (in units of visible length of the list) the leading edge of the\n   * list must be from the start of the content to trigger the `onStartReached` callback.\n   * Thus, a value of 0.5 will trigger `onStartReached` when the start of the content is\n   * within half the visible length of the list.\n   */\n  onStartReachedThreshold?: ?number,\n  /**\n   * Called when the viewability of rows changes, as defined by the\n   * `viewabilityConfig` prop.\n   */\n  onViewableItemsChanged?: ?(info: {\n    viewableItems: Array<ViewToken>,\n    changed: Array<ViewToken>,\n    ...\n  }) => void,\n  persistentScrollbar?: ?boolean,\n  /**\n   * Set this when offset is needed for the loading indicator to show correctly.\n   */\n  progressViewOffset?: number,\n  /**\n   * A custom refresh control element. When set, it overrides the default\n   * <RefreshControl> component built internally. The onRefresh and refreshing\n   * props are also ignored. Only works for vertical VirtualizedList.\n   */\n  refreshControl?: ?React.Element<any>,\n  /**\n   * Set this true while waiting for new data from a refresh.\n   */\n  refreshing?: ?boolean,\n  /**\n   * Note: may have bugs (missing content) in some circumstances - use at your own risk.\n   *\n   * This may improve scroll performance for large lists.\n   */\n  removeClippedSubviews?: boolean,\n  /**\n   * Render a custom scroll component, e.g. with a differently styled `RefreshControl`.\n   */\n  renderScrollComponent?: (props: Object) => React.Element<any>,\n  /**\n   * Amount of time between low-pri item render batches, e.g. for rendering items quite a ways off\n   * screen. Similar fill rate/responsiveness tradeoff as `maxToRenderPerBatch`.\n   */\n  updateCellsBatchingPeriod?: ?number,\n  /**\n   * See `ViewabilityHelper` for flow type and further documentation.\n   */\n  viewabilityConfig?: ViewabilityConfig,\n  /**\n   * List of ViewabilityConfig/onViewableItemsChanged pairs. A specific onViewableItemsChanged\n   * will be called when its corresponding ViewabilityConfig's conditions are met.\n   */\n  viewabilityConfigCallbackPairs?: Array<ViewabilityConfigCallbackPair>,\n  /**\n   * Determines the maximum number of items rendered outside of the visible area, in units of\n   * visible lengths. So if your list fills the screen, then `windowSize={21}` (the default) will\n   * render the visible screen area plus up to 10 screens above and 10 below the viewport. Reducing\n   * this number will reduce memory consumption and may improve performance, but will increase the\n   * chance that fast scrolling may reveal momentary blank areas of unrendered content.\n   */\n  windowSize?: ?number,\n  /**\n   * The legacy implementation is no longer supported.\n   */\n  legacyImplementation?: empty,\n|};\n\nexport type Props = {|\n  ...React.ElementConfig<typeof ScrollView>,\n  ...RequiredProps,\n  ...OptionalProps,\n|};\n\n/**\n * Subset of properties needed to calculate frame metrics\n */\nexport type FrameMetricProps = {\n  data: RequiredProps['data'],\n  getItemCount: RequiredProps['getItemCount'],\n  getItem: RequiredProps['getItem'],\n  getItemLayout?: OptionalProps['getItemLayout'],\n  keyExtractor?: OptionalProps['keyExtractor'],\n  ...\n};\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/VirtualizedList/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\nimport type { LayoutEvent } from '../../../types';\nimport type {\n  ScrollEvent,\n} from '../Types/CoreEventTypes';\nimport type {ViewToken} from '../ViewabilityHelper';\nimport type {\n  FrameMetricProps,\n  Item,\n  Props,\n  RenderItemProps,\n  RenderItemType,\n  Separators,\n} from './VirtualizedListProps';\n\nimport RefreshControl from '../../../exports/RefreshControl';\nimport ScrollView from '../../../exports/ScrollView';\nimport View, { type ViewProps } from '../../../exports/View';\nimport StyleSheet from '../../../exports/StyleSheet';\n\nimport Batchinator from '../Batchinator';\nimport clamp from '../Utilities/clamp';\nimport infoLog from '../infoLog';\nimport {CellRenderMask} from './CellRenderMask';\nimport ChildListCollection from './ChildListCollection';\nimport FillRateHelper from '../FillRateHelper';\nimport StateSafePureComponent from './StateSafePureComponent';\nimport ViewabilityHelper from '../ViewabilityHelper';\nimport CellRenderer from './VirtualizedListCellRenderer';\nimport {\n  VirtualizedListCellContextProvider,\n  VirtualizedListContext,\n  VirtualizedListContextProvider,\n} from './VirtualizedListContext.js';\nimport {\n  computeWindowedRenderLimits,\n  keyExtractor as defaultKeyExtractor,\n} from '../VirtualizeUtils';\nimport invariant from 'fbjs/lib/invariant';\nimport nullthrows from 'nullthrows';\nimport * as React from 'react';\n\nexport type {RenderItemProps, RenderItemType, Separators};\n\nconst __DEV__ = process.env.NODE_ENV !== 'production';\n\nconst ON_EDGE_REACHED_EPSILON = 0.001;\n\nlet _usedIndexForKey = false;\nlet _keylessItemComponentName: string = '';\n\ntype ScrollResponderType = any;\ntype ViewStyleProp = $PropertyType<ViewProps, 'style'>;\n\ntype ViewabilityHelperCallbackTuple = {\n  viewabilityHelper: ViewabilityHelper,\n  onViewableItemsChanged: (info: {\n    viewableItems: Array<ViewToken>,\n    changed: Array<ViewToken>,\n    ...\n  }) => void,\n  ...\n};\n\ntype State = {\n  renderMask: CellRenderMask,\n  cellsAroundViewport: {first: number, last: number},\n};\n\n/**\n * Default Props Helper Functions\n * Use the following helper functions for default values\n */\n\n// horizontalOrDefault(this.props.horizontal)\nfunction horizontalOrDefault(horizontal: ?boolean) {\n  return horizontal ?? false;\n}\n\n// initialNumToRenderOrDefault(this.props.initialNumToRender)\nfunction initialNumToRenderOrDefault(initialNumToRender: ?number) {\n  return initialNumToRender ?? 10;\n}\n\n// maxToRenderPerBatchOrDefault(this.props.maxToRenderPerBatch)\nfunction maxToRenderPerBatchOrDefault(maxToRenderPerBatch: ?number) {\n  return maxToRenderPerBatch ?? 10;\n}\n\n// onStartReachedThresholdOrDefault(this.props.onStartReachedThreshold)\nfunction onStartReachedThresholdOrDefault(onStartReachedThreshold: ?number) {\n  return onStartReachedThreshold ?? 2;\n}\n\n// onEndReachedThresholdOrDefault(this.props.onEndReachedThreshold)\nfunction onEndReachedThresholdOrDefault(onEndReachedThreshold: ?number) {\n  return onEndReachedThreshold ?? 2;\n}\n\n// getScrollingThreshold(visibleLength, onEndReachedThreshold)\nfunction getScrollingThreshold(threshold: number, visibleLength: number) {\n  return (threshold * visibleLength) / 2;\n}\n\n// scrollEventThrottleOrDefault(this.props.scrollEventThrottle)\nfunction scrollEventThrottleOrDefault(scrollEventThrottle: ?number) {\n  return scrollEventThrottle ?? 50;\n}\n\n// windowSizeOrDefault(this.props.windowSize)\nfunction windowSizeOrDefault(windowSize: ?number) {\n  return windowSize ?? 21;\n}\n\nfunction findLastWhere<T>(\n  arr: $ReadOnlyArray<T>,\n  predicate: (element: T) => boolean,\n): T | null {\n  for (let i = arr.length - 1; i >= 0; i--) {\n    if (predicate(arr[i])) {\n      return arr[i];\n    }\n  }\n\n  return null;\n}\n\n/**\n * Base implementation for the more convenient [`<FlatList>`](https://reactnative.dev/docs/flatlist)\n * and [`<SectionList>`](https://reactnative.dev/docs/sectionlist) components, which are also better\n * documented. In general, this should only really be used if you need more flexibility than\n * `FlatList` provides, e.g. for use with immutable data instead of plain arrays.\n *\n * Virtualization massively improves memory consumption and performance of large lists by\n * maintaining a finite render window of active items and replacing all items outside of the render\n * window with appropriately sized blank space. The window adapts to scrolling behavior, and items\n * are rendered incrementally with low-pri (after any running interactions) if they are far from the\n * visible area, or with hi-pri otherwise to minimize the potential of seeing blank space.\n *\n * Some caveats:\n *\n * - Internal state is not preserved when content scrolls out of the render window. Make sure all\n *   your data is captured in the item data or external stores like Flux, Redux, or Relay.\n * - This is a `PureComponent` which means that it will not re-render if `props` remain shallow-\n *   equal. Make sure that everything your `renderItem` function depends on is passed as a prop\n *   (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on\n *   changes. This includes the `data` prop and parent component state.\n * - In order to constrain memory and enable smooth scrolling, content is rendered asynchronously\n *   offscreen. This means it's possible to scroll faster than the fill rate ands momentarily see\n *   blank content. This is a tradeoff that can be adjusted to suit the needs of each application,\n *   and we are working on improving it behind the scenes.\n * - By default, the list looks for a `key` or `id` prop on each item and uses that for the React key.\n *   Alternatively, you can provide a custom `keyExtractor` prop.\n * - As an effort to remove defaultProps, use helper functions when referencing certain props\n *\n */\nclass VirtualizedList extends StateSafePureComponent<Props, State> {\n  static contextType: typeof VirtualizedListContext = VirtualizedListContext;\n\n  // scrollToEnd may be janky without getItemLayout prop\n  scrollToEnd(params?: ?{animated?: ?boolean, ...}) {\n    const animated = params ? params.animated : true;\n    const veryLast = this.props.getItemCount(this.props.data) - 1;\n    if (veryLast < 0) {\n      return;\n    }\n    const frame = this.__getFrameMetricsApprox(veryLast, this.props);\n    const offset = Math.max(\n      0,\n      frame.offset +\n        frame.length +\n        this._footerLength -\n        this._scrollMetrics.visibleLength,\n    );\n\n    if (this._scrollRef == null) {\n      return;\n    }\n\n    if (this._scrollRef.scrollTo == null) {\n      console.warn(\n        'No scrollTo method provided. This may be because you have two nested ' +\n          'VirtualizedLists with the same orientation, or because you are ' +\n          'using a custom component that does not implement scrollTo.',\n      );\n      return;\n    }\n\n    this._scrollRef.scrollTo(\n      horizontalOrDefault(this.props.horizontal)\n        ? {x: offset, animated}\n        : {y: offset, animated},\n    );\n  }\n\n  // scrollToIndex may be janky without getItemLayout prop\n  scrollToIndex(params: {\n    animated?: ?boolean,\n    index: number,\n    viewOffset?: number,\n    viewPosition?: number,\n    ...\n  }): $FlowFixMe {\n    const {\n      data,\n      horizontal,\n      getItemCount,\n      getItemLayout,\n      onScrollToIndexFailed,\n    } = this.props;\n    const {animated, index, viewOffset, viewPosition} = params;\n    invariant(\n      index >= 0,\n      `scrollToIndex out of range: requested index ${index} but minimum is 0`,\n    );\n    invariant(\n      getItemCount(data) >= 1,\n      `scrollToIndex out of range: item length ${getItemCount(\n        data,\n      )} but minimum is 1`,\n    );\n    invariant(\n      index < getItemCount(data),\n      `scrollToIndex out of range: requested index ${index} is out of 0 to ${\n        getItemCount(data) - 1\n      }`,\n    );\n    if (!getItemLayout && index > this._highestMeasuredFrameIndex) {\n      invariant(\n        !!onScrollToIndexFailed,\n        'scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, ' +\n          'otherwise there is no way to know the location of offscreen indices or handle failures.',\n      );\n      onScrollToIndexFailed({\n        averageItemLength: this._averageCellLength,\n        highestMeasuredFrameIndex: this._highestMeasuredFrameIndex,\n        index,\n      });\n      return;\n    }\n    const frame = this.__getFrameMetricsApprox(Math.floor(index), this.props);\n    const offset =\n      Math.max(\n        0,\n        this._getOffsetApprox(index, this.props) -\n          (viewPosition || 0) *\n            (this._scrollMetrics.visibleLength - frame.length),\n      ) - (viewOffset || 0);\n\n    if (this._scrollRef == null) {\n      return;\n    }\n\n    if (this._scrollRef.scrollTo == null) {\n      console.warn(\n        'No scrollTo method provided. This may be because you have two nested ' +\n          'VirtualizedLists with the same orientation, or because you are ' +\n          'using a custom component that does not implement scrollTo.',\n      );\n      return;\n    }\n\n    this._scrollRef.scrollTo(\n      horizontal ? {x: offset, animated} : {y: offset, animated},\n    );\n  }\n\n  // scrollToItem may be janky without getItemLayout prop. Required linear scan through items -\n  // use scrollToIndex instead if possible.\n  scrollToItem(params: {\n    animated?: ?boolean,\n    item: Item,\n    viewOffset?: number,\n    viewPosition?: number,\n    ...\n  }) {\n    const {item} = params;\n    const {data, getItem, getItemCount} = this.props;\n    const itemCount = getItemCount(data);\n    for (let index = 0; index < itemCount; index++) {\n      if (getItem(data, index) === item) {\n        this.scrollToIndex({...params, index});\n        break;\n      }\n    }\n  }\n\n  /**\n   * Scroll to a specific content pixel offset in the list.\n   *\n   * Param `offset` expects the offset to scroll to.\n   * In case of `horizontal` is true, the offset is the x-value,\n   * in any other case the offset is the y-value.\n   *\n   * Param `animated` (`true` by default) defines whether the list\n   * should do an animation while scrolling.\n   */\n  scrollToOffset(params: {animated?: ?boolean, offset: number, ...}) {\n    const {animated, offset} = params;\n\n    if (this._scrollRef == null) {\n      return;\n    }\n\n    if (this._scrollRef.scrollTo == null) {\n      console.warn(\n        'No scrollTo method provided. This may be because you have two nested ' +\n          'VirtualizedLists with the same orientation, or because you are ' +\n          'using a custom component that does not implement scrollTo.',\n      );\n      return;\n    }\n\n    this._scrollRef.scrollTo(\n      horizontalOrDefault(this.props.horizontal)\n        ? {x: offset, animated}\n        : {y: offset, animated},\n    );\n  }\n\n  recordInteraction() {\n    this._nestedChildLists.forEach(childList => {\n      childList.recordInteraction();\n    });\n    this._viewabilityTuples.forEach(t => {\n      t.viewabilityHelper.recordInteraction();\n    });\n    this._updateViewableItems(this.props, this.state.cellsAroundViewport);\n  }\n\n  flashScrollIndicators() {\n    if (this._scrollRef == null) {\n      return;\n    }\n\n    this._scrollRef.flashScrollIndicators();\n  }\n\n  /**\n   * Provides a handle to the underlying scroll responder.\n   * Note that `this._scrollRef` might not be a `ScrollView`, so we\n   * need to check that it responds to `getScrollResponder` before calling it.\n   */\n  getScrollResponder(): ?ScrollResponderType {\n    if (this._scrollRef && this._scrollRef.getScrollResponder) {\n      return this._scrollRef.getScrollResponder();\n    }\n  }\n\n  getScrollableNode(): ?number {\n    if (this._scrollRef && this._scrollRef.getScrollableNode) {\n      return this._scrollRef.getScrollableNode();\n    } else {\n      return this._scrollRef;\n    }\n  }\n\n  getScrollRef():\n    | ?React.ElementRef<typeof ScrollView>\n    | ?React.ElementRef<typeof View> {\n    if (this._scrollRef && this._scrollRef.getScrollRef) {\n      return this._scrollRef.getScrollRef();\n    } else {\n      return this._scrollRef;\n    }\n  }\n\n  _getCellKey(): string {\n    return this.context?.cellKey || 'rootList';\n  }\n\n  // $FlowFixMe[missing-local-annot]\n  _getScrollMetrics = () => {\n    return this._scrollMetrics;\n  };\n\n  hasMore(): boolean {\n    return this._hasMore;\n  }\n\n  // $FlowFixMe[missing-local-annot]\n  _getOutermostParentListRef = () => {\n    if (this._isNestedWithSameOrientation()) {\n      return this.context.getOutermostParentListRef();\n    } else {\n      return this;\n    }\n  };\n\n  _registerAsNestedChild = (childList: {\n    cellKey: string,\n    ref: React.ElementRef<typeof VirtualizedList>,\n  }): void => {\n    this._nestedChildLists.add(childList.ref, childList.cellKey);\n    if (this._hasInteracted) {\n      childList.ref.recordInteraction();\n    }\n  };\n\n  _unregisterAsNestedChild = (childList: {\n    ref: React.ElementRef<typeof VirtualizedList>,\n  }): void => {\n    this._nestedChildLists.remove(childList.ref);\n  };\n\n  state: State;\n\n   // REACT-NATIVE-WEB patch to preserve during future RN merges: Support inverted wheel scroller.\n   invertedWheelEventHandler: ?(ev: any) => void;\n\n  constructor(props: Props) {\n    super(props);\n    this._checkProps(props);\n\n    this._fillRateHelper = new FillRateHelper(this._getFrameMetrics);\n    this._updateCellsToRenderBatcher = new Batchinator(\n      this._updateCellsToRender,\n      this.props.updateCellsBatchingPeriod ?? 50,\n    );\n\n    if (this.props.viewabilityConfigCallbackPairs) {\n      this._viewabilityTuples = this.props.viewabilityConfigCallbackPairs.map(\n        pair => ({\n          viewabilityHelper: new ViewabilityHelper(pair.viewabilityConfig),\n          onViewableItemsChanged: pair.onViewableItemsChanged,\n        }),\n      );\n    } else {\n      const {onViewableItemsChanged, viewabilityConfig} = this.props;\n      if (onViewableItemsChanged) {\n        this._viewabilityTuples.push({\n          viewabilityHelper: new ViewabilityHelper(viewabilityConfig),\n          onViewableItemsChanged: onViewableItemsChanged,\n        });\n      }\n    }\n\n    const initialRenderRegion = VirtualizedList._initialRenderRegion(props);\n\n    this.state = {\n      cellsAroundViewport: initialRenderRegion,\n      renderMask: VirtualizedList._createRenderMask(props, initialRenderRegion),\n    };\n\n      // REACT-NATIVE-WEB patch to preserve during future RN merges: Support inverted wheel scroller.\n    // For issue https://github.com/necolas/react-native-web/issues/995\n    this.invertedWheelEventHandler = (ev: any) => {\n      const scrollOffset = this.props.horizontal ? ev.target.scrollLeft : ev.target.scrollTop;\n      const scrollLength = this.props.horizontal ? ev.target.scrollWidth : ev.target.scrollHeight;\n      const clientLength = this.props.horizontal ? ev.target.clientWidth : ev.target.clientHeight;\n      const isEventTargetScrollable = scrollLength > clientLength;\n      const delta = this.props.horizontal\n        ? ev.deltaX || ev.wheelDeltaX\n        : ev.deltaY || ev.wheelDeltaY;\n      let leftoverDelta = delta;\n      if (isEventTargetScrollable) {\n        leftoverDelta = delta < 0\n          ? Math.min(delta + scrollOffset, 0)\n          : Math.max(delta - (scrollLength - clientLength - scrollOffset), 0);\n      }\n      const targetDelta = delta - leftoverDelta;\n\n      if (this.props.inverted && this._scrollRef && this._scrollRef.getScrollableNode) {\n        const node = (this._scrollRef: any).getScrollableNode();\n        if (this.props.horizontal) {\n          ev.target.scrollLeft += targetDelta;\n          const nextScrollLeft = node.scrollLeft - leftoverDelta;\n          node.scrollLeft = !this.props.getItemLayout ? Math.min(nextScrollLeft, this._totalCellLength) : nextScrollLeft;\n        } else {\n          ev.target.scrollTop += targetDelta;\n          const nextScrollTop = node.scrollTop - leftoverDelta;\n          node.scrollTop = !this.props.getItemLayout ? Math.min(nextScrollTop, this._totalCellLength) : nextScrollTop;\n        }\n        ev.preventDefault();\n      }\n    };\n  }\n\n  _checkProps(props: Props) {\n    const {onScroll, windowSize, getItemCount, data, initialScrollIndex} =\n      props;\n\n    invariant(\n      // $FlowFixMe[prop-missing]\n      !onScroll || !onScroll.__isNative,\n      'Components based on VirtualizedList must be wrapped with Animated.createAnimatedComponent ' +\n        'to support native onScroll events with useNativeDriver',\n    );\n    invariant(\n      windowSizeOrDefault(windowSize) > 0,\n      'VirtualizedList: The windowSize prop must be present and set to a value greater than 0.',\n    );\n\n    invariant(\n      getItemCount,\n      'VirtualizedList: The \"getItemCount\" prop must be provided',\n    );\n\n    const itemCount = getItemCount(data);\n\n    if (\n      initialScrollIndex != null &&\n      !this._hasTriggeredInitialScrollToIndex &&\n      (initialScrollIndex < 0 ||\n        (itemCount > 0 && initialScrollIndex >= itemCount)) &&\n      !this._hasWarned.initialScrollIndex\n    ) {\n      console.warn(\n        `initialScrollIndex \"${initialScrollIndex}\" is not valid (list has ${itemCount} items)`,\n      );\n      this._hasWarned.initialScrollIndex = true;\n    }\n\n    if (__DEV__ && !this._hasWarned.flexWrap) {\n      // $FlowFixMe[underconstrained-implicit-instantiation]\n      const flatStyles = StyleSheet.flatten(this.props.contentContainerStyle);\n      if (flatStyles != null && flatStyles.flexWrap === 'wrap') {\n        console.warn(\n          '`flexWrap: `wrap`` is not supported with the `VirtualizedList` components.' +\n            'Consider using `numColumns` with `FlatList` instead.',\n        );\n        this._hasWarned.flexWrap = true;\n      }\n    }\n  }\n\n  static _createRenderMask(\n    props: Props,\n    cellsAroundViewport: {first: number, last: number},\n    additionalRegions?: ?$ReadOnlyArray<{first: number, last: number}>,\n  ): CellRenderMask {\n    const itemCount = props.getItemCount(props.data);\n\n    invariant(\n      cellsAroundViewport.first >= 0 &&\n        cellsAroundViewport.last >= cellsAroundViewport.first - 1 &&\n        cellsAroundViewport.last < itemCount,\n      `Invalid cells around viewport \"[${cellsAroundViewport.first}, ${cellsAroundViewport.last}]\" was passed to VirtualizedList._createRenderMask`,\n    );\n\n    const renderMask = new CellRenderMask(itemCount);\n\n    if (itemCount > 0) {\n      const allRegions = [cellsAroundViewport, ...(additionalRegions ?? [])];\n      for (const region of allRegions) {\n        renderMask.addCells(region);\n      }\n\n      // The initially rendered cells are retained as part of the\n      // \"scroll-to-top\" optimization\n      if (props.initialScrollIndex == null || props.initialScrollIndex <= 0) {\n        const initialRegion = VirtualizedList._initialRenderRegion(props);\n        renderMask.addCells(initialRegion);\n      }\n\n      // The layout coordinates of sticker headers may be off-screen while the\n      // actual header is on-screen. Keep the most recent before the viewport\n      // rendered, even if its layout coordinates are not in viewport.\n      const stickyIndicesSet = new Set(props.stickyHeaderIndices);\n      VirtualizedList._ensureClosestStickyHeader(\n        props,\n        stickyIndicesSet,\n        renderMask,\n        cellsAroundViewport.first,\n      );\n    }\n\n    return renderMask;\n  }\n\n  static _initialRenderRegion(props: Props): {first: number, last: number} {\n    const itemCount = props.getItemCount(props.data);\n\n    const firstCellIndex = Math.max(\n      0,\n      Math.min(itemCount - 1, Math.floor(props.initialScrollIndex ?? 0)),\n    );\n\n    const lastCellIndex =\n      Math.min(\n        itemCount,\n        firstCellIndex + initialNumToRenderOrDefault(props.initialNumToRender),\n      ) - 1;\n\n    return {\n      first: firstCellIndex,\n      last: lastCellIndex,\n    };\n  }\n\n  static _ensureClosestStickyHeader(\n    props: Props,\n    stickyIndicesSet: Set<number>,\n    renderMask: CellRenderMask,\n    cellIdx: number,\n  ) {\n    const stickyOffset = props.ListHeaderComponent ? 1 : 0;\n\n    for (let itemIdx = cellIdx - 1; itemIdx >= 0; itemIdx--) {\n      if (stickyIndicesSet.has(itemIdx + stickyOffset)) {\n        renderMask.addCells({first: itemIdx, last: itemIdx});\n        break;\n      }\n    }\n  }\n\n  _adjustCellsAroundViewport(\n    props: Props,\n    cellsAroundViewport: {first: number, last: number},\n  ): {first: number, last: number} {\n    const {data, getItemCount} = props;\n    const onEndReachedThreshold = onEndReachedThresholdOrDefault(\n      props.onEndReachedThreshold,\n    );\n    const {contentLength, offset, visibleLength} = this._scrollMetrics;\n    const distanceFromEnd = contentLength - visibleLength - offset;\n\n    // Wait until the scroll view metrics have been set up. And until then,\n    // we will trust the initialNumToRender suggestion\n    if (visibleLength <= 0 || contentLength <= 0) {\n      return cellsAroundViewport.last >= getItemCount(data)\n        ? VirtualizedList._constrainToItemCount(cellsAroundViewport, props)\n        : cellsAroundViewport;\n    }\n\n    let newCellsAroundViewport: {first: number, last: number};\n    if (props.disableVirtualization) {\n      const renderAhead =\n        distanceFromEnd < onEndReachedThreshold * visibleLength\n          ? maxToRenderPerBatchOrDefault(props.maxToRenderPerBatch)\n          : 0;\n\n      newCellsAroundViewport = {\n        first: 0,\n        last: Math.min(\n          cellsAroundViewport.last + renderAhead,\n          getItemCount(data) - 1,\n        ),\n      };\n    } else {\n      // If we have a non-zero initialScrollIndex and run this before we've scrolled,\n      // we'll wipe out the initialNumToRender rendered elements starting at initialScrollIndex.\n      // So let's wait until we've scrolled the view to the right place. And until then,\n      // we will trust the initialScrollIndex suggestion.\n\n      // Thus, we want to recalculate the windowed render limits if any of the following hold:\n      // - initialScrollIndex is undefined or is 0\n      // - initialScrollIndex > 0 AND scrolling is complete\n      // - initialScrollIndex > 0 AND the end of the list is visible (this handles the case\n      //   where the list is shorter than the visible area)\n      if (\n        props.initialScrollIndex &&\n        !this._scrollMetrics.offset &&\n        Math.abs(distanceFromEnd) >= Number.EPSILON\n      ) {\n        return cellsAroundViewport.last >= getItemCount(data)\n          ? VirtualizedList._constrainToItemCount(cellsAroundViewport, props)\n          : cellsAroundViewport;\n      }\n\n      newCellsAroundViewport = computeWindowedRenderLimits(\n        props,\n        maxToRenderPerBatchOrDefault(props.maxToRenderPerBatch),\n        windowSizeOrDefault(props.windowSize),\n        cellsAroundViewport,\n        this.__getFrameMetricsApprox,\n        this._scrollMetrics,\n      );\n      invariant(\n        newCellsAroundViewport.last < getItemCount(data),\n        'computeWindowedRenderLimits() should return range in-bounds',\n      );\n    }\n\n    if (this._nestedChildLists.size() > 0) {\n      // If some cell in the new state has a child list in it, we should only render\n      // up through that item, so that we give that list a chance to render.\n      // Otherwise there's churn from multiple child lists mounting and un-mounting\n      // their items.\n\n      // Will this prevent rendering if the nested list doesn't realize the end?\n      const childIdx = this._findFirstChildWithMore(\n        newCellsAroundViewport.first,\n        newCellsAroundViewport.last,\n      );\n\n      newCellsAroundViewport.last = childIdx ?? newCellsAroundViewport.last;\n    }\n\n    return newCellsAroundViewport;\n  }\n\n  _findFirstChildWithMore(first: number, last: number): number | null {\n    for (let ii = first; ii <= last; ii++) {\n      const cellKeyForIndex = this._indicesToKeys.get(ii);\n      if (\n        cellKeyForIndex != null &&\n        this._nestedChildLists.anyInCell(cellKeyForIndex, childList =>\n          childList.hasMore(),\n        )\n      ) {\n        return ii;\n      }\n    }\n\n    return null;\n  }\n\n  componentDidMount() {\n    if (this._isNestedWithSameOrientation()) {\n      this.context.registerAsNestedChild({\n        ref: this,\n        cellKey: this.context.cellKey,\n      });\n    }\n\n    // REACT-NATIVE-WEB patch to preserve during future RN merges: Support inverted wheel scroller.\n    this.setupWebWheelHandler();\n  }\n\n  componentWillUnmount() {\n    if (this._isNestedWithSameOrientation()) {\n      this.context.unregisterAsNestedChild({ref: this});\n    }\n    this._updateCellsToRenderBatcher.dispose({abort: true});\n    this._viewabilityTuples.forEach(tuple => {\n      tuple.viewabilityHelper.dispose();\n    });\n    this._fillRateHelper.deactivateAndFlush();\n\n    // REACT-NATIVE-WEB patch to preserve during future RN merges: Support inverted wheel scroller.\n    this.teardownWebWheelHandler();\n  }\n\n  // REACT-NATIVE-WEB patch to preserve during future RN merges: Support inverted wheel scroller.\n  setupWebWheelHandler() {\n    if (this._scrollRef && this._scrollRef.getScrollableNode) {\n      this._scrollRef.getScrollableNode().addEventListener('wheel',\n          this.invertedWheelEventHandler\n      );\n    } else {\n      setTimeout(() => this.setupWebWheelHandler(), 50);\n      return\n    }\n  }\n\n  // REACT-NATIVE-WEB patch to preserve during future RN merges: Support inverted wheel scroller.\n  teardownWebWheelHandler() {\n    if (this._scrollRef && this._scrollRef.getScrollableNode) {\n      this._scrollRef.getScrollableNode().removeEventListener('wheel',\n          this.invertedWheelEventHandler\n      );\n    }\n  }\n\n  static getDerivedStateFromProps(newProps: Props, prevState: State): State {\n    // first and last could be stale (e.g. if a new, shorter items props is passed in), so we make\n    // sure we're rendering a reasonable range here.\n    const itemCount = newProps.getItemCount(newProps.data);\n    if (itemCount === prevState.renderMask.numCells()) {\n      return prevState;\n    }\n\n    const constrainedCells = VirtualizedList._constrainToItemCount(\n      prevState.cellsAroundViewport,\n      newProps,\n    );\n\n    return {\n      cellsAroundViewport: constrainedCells,\n      renderMask: VirtualizedList._createRenderMask(newProps, constrainedCells),\n    };\n  }\n\n  _pushCells(\n    cells: Array<Object>,\n    stickyHeaderIndices: Array<number>,\n    stickyIndicesFromProps: Set<number>,\n    first: number,\n    last: number,\n    inversionStyle: ViewStyleProp,\n  ) {\n    const {\n      CellRendererComponent,\n      ItemSeparatorComponent,\n      ListHeaderComponent,\n      ListItemComponent,\n      data,\n      debug,\n      getItem,\n      getItemCount,\n      getItemLayout,\n      horizontal,\n      renderItem,\n    } = this.props;\n    const stickyOffset = ListHeaderComponent ? 1 : 0;\n    const end = getItemCount(data) - 1;\n    let prevCellKey;\n    last = Math.min(end, last);\n\n    for (let ii = first; ii <= last; ii++) {\n      const item = getItem(data, ii);\n      const key = this._keyExtractor(item, ii, this.props);\n\n      this._indicesToKeys.set(ii, key);\n      if (stickyIndicesFromProps.has(ii + stickyOffset)) {\n        stickyHeaderIndices.push(cells.length);\n      }\n\n      const shouldListenForLayout =\n        getItemLayout == null || debug || this._fillRateHelper.enabled();\n\n      cells.push(\n        <CellRenderer\n          CellRendererComponent={CellRendererComponent}\n          ItemSeparatorComponent={ii < end ? ItemSeparatorComponent : undefined}\n          ListItemComponent={ListItemComponent}\n          cellKey={key}\n          horizontal={horizontal}\n          index={ii}\n          inversionStyle={inversionStyle}\n          item={item}\n          key={key}\n          prevCellKey={prevCellKey}\n          onUpdateSeparators={this._onUpdateSeparators}\n          onCellFocusCapture={e => this._onCellFocusCapture(key)}\n          onUnmount={this._onCellUnmount}\n          ref={ref => {\n            this._cellRefs[key] = ref;\n          }}\n          renderItem={renderItem}\n          {...(shouldListenForLayout && {\n            onCellLayout: this._onCellLayout,\n          })}\n        />,\n      );\n      prevCellKey = key;\n    }\n  }\n\n  static _constrainToItemCount(\n    cells: {first: number, last: number},\n    props: Props,\n  ): {first: number, last: number} {\n    const itemCount = props.getItemCount(props.data);\n    const last = Math.min(itemCount - 1, cells.last);\n\n    const maxToRenderPerBatch = maxToRenderPerBatchOrDefault(\n      props.maxToRenderPerBatch,\n    );\n\n    return {\n      first: clamp(0, itemCount - 1 - maxToRenderPerBatch, cells.first),\n      last,\n    };\n  }\n\n  _onUpdateSeparators = (keys: Array<?string>, newProps: Object) => {\n    keys.forEach(key => {\n      const ref = key != null && this._cellRefs[key];\n      ref && ref.updateSeparatorProps(newProps);\n    });\n  };\n\n  _isNestedWithSameOrientation(): boolean {\n    const nestedContext = this.context;\n    return !!(\n      nestedContext &&\n      !!nestedContext.horizontal === horizontalOrDefault(this.props.horizontal)\n    );\n  }\n\n  _getSpacerKey = (isVertical: boolean): string =>\n    isVertical ? 'height' : 'width';\n\n  _keyExtractor(\n    item: Item,\n    index: number,\n    props: {\n      keyExtractor?: ?(item: Item, index: number) => string,\n      ...\n    },\n    // $FlowFixMe[missing-local-annot]\n  ) {\n    if (props.keyExtractor != null) {\n      return props.keyExtractor(item, index);\n    }\n\n    const key = defaultKeyExtractor(item, index);\n    if (key === String(index)) {\n      _usedIndexForKey = true;\n      if (item.type && item.type.displayName) {\n        _keylessItemComponentName = item.type.displayName;\n      }\n    }\n    return key;\n  }\n\n  render(): React.Node {\n    this._checkProps(this.props);\n    const {ListEmptyComponent, ListFooterComponent, ListHeaderComponent} =\n      this.props;\n    const {data, horizontal} = this.props;\n    const inversionStyle = this.props.inverted\n      ? horizontalOrDefault(this.props.horizontal)\n        ? styles.horizontallyInverted\n        : styles.verticallyInverted\n      : null;\n    const cells: Array<any | React.Node> = [];\n    const stickyIndicesFromProps = new Set(this.props.stickyHeaderIndices);\n    const stickyHeaderIndices = [];\n\n    // 1. Add cell for ListHeaderComponent\n    if (ListHeaderComponent) {\n      if (stickyIndicesFromProps.has(0)) {\n        stickyHeaderIndices.push(0);\n      }\n      const element = React.isValidElement(ListHeaderComponent) ? (\n        ListHeaderComponent\n      ) : (\n        // $FlowFixMe[not-a-component]\n        // $FlowFixMe[incompatible-type-arg]\n        <ListHeaderComponent />\n      );\n      cells.push(\n        <VirtualizedListCellContextProvider\n          cellKey={this._getCellKey() + '-header'}\n          key=\"$header\">\n          <View\n            onLayout={this._onLayoutHeader}\n            style={[\n              inversionStyle,\n              this.props.ListHeaderComponentStyle,\n            ]}>\n            {\n              // $FlowFixMe[incompatible-type] - Typing ReactNativeComponent revealed errors\n              element\n            }\n          </View>\n        </VirtualizedListCellContextProvider>,\n      );\n    }\n\n    // 2a. Add a cell for ListEmptyComponent if applicable\n    const itemCount = this.props.getItemCount(data);\n    if (itemCount === 0 && ListEmptyComponent) {\n      const element: React.Element<any> = ((React.isValidElement(\n        ListEmptyComponent,\n      ) ? (\n        ListEmptyComponent\n      ) : (\n        // $FlowFixMe[not-a-component]\n        // $FlowFixMe[incompatible-type-arg]\n        <ListEmptyComponent />\n      )): any);\n      cells.push(\n        <VirtualizedListCellContextProvider\n          cellKey={this._getCellKey() + '-empty'}\n          key=\"$empty\">\n          {React.cloneElement(element, {\n            onLayout: (event: LayoutEvent) => {\n              this._onLayoutEmpty(event);\n              if (element.props.onLayout) {\n                element.props.onLayout(event);\n              }\n            },\n            style: [inversionStyle, element.props.style],\n          })}\n        </VirtualizedListCellContextProvider>,\n      );\n    }\n\n    // 2b. Add cells and spacers for each item\n    if (itemCount > 0) {\n      _usedIndexForKey = false;\n      _keylessItemComponentName = '';\n      const spacerKey = this._getSpacerKey(!horizontal);\n\n      const renderRegions = this.state.renderMask.enumerateRegions();\n      const lastSpacer = findLastWhere(renderRegions, r => r.isSpacer);\n\n      for (const section of renderRegions) {\n        if (section.isSpacer) {\n          // Legacy behavior is to avoid spacers when virtualization is\n          // disabled (including head spacers on initial render).\n          if (this.props.disableVirtualization) {\n            continue;\n          }\n\n          // Without getItemLayout, we limit our tail spacer to the _highestMeasuredFrameIndex to\n          // prevent the user for hyperscrolling into un-measured area because otherwise content will\n          // likely jump around as it renders in above the viewport.\n          const isLastSpacer = section === lastSpacer;\n          const constrainToMeasured = isLastSpacer && !this.props.getItemLayout;\n          const last = constrainToMeasured\n            ? clamp(\n                section.first - 1,\n                section.last,\n                this._highestMeasuredFrameIndex,\n              )\n            : section.last;\n\n          const firstMetrics = this.__getFrameMetricsApprox(\n            section.first,\n            this.props,\n          );\n          const lastMetrics = this.__getFrameMetricsApprox(last, this.props);\n          const spacerSize =\n            lastMetrics.offset + lastMetrics.length - firstMetrics.offset;\n          cells.push(\n            <View\n              key={`$spacer-${section.first}`}\n              style={{[spacerKey]: spacerSize}}\n            />,\n          );\n        } else {\n          this._pushCells(\n            cells,\n            stickyHeaderIndices,\n            stickyIndicesFromProps,\n            section.first,\n            section.last,\n            inversionStyle,\n          );\n        }\n      }\n\n      if (!this._hasWarned.keys && _usedIndexForKey) {\n        console.warn(\n          'VirtualizedList: missing keys for items, make sure to specify a key or id property on each ' +\n            'item or provide a custom keyExtractor.',\n          _keylessItemComponentName,\n        );\n        this._hasWarned.keys = true;\n      }\n    }\n\n    // 3. Add cell for ListFooterComponent\n    if (ListFooterComponent) {\n      const element = React.isValidElement(ListFooterComponent) ? (\n        ListFooterComponent\n      ) : (\n        // $FlowFixMe[not-a-component]\n        // $FlowFixMe[incompatible-type-arg]\n        <ListFooterComponent />\n      );\n      cells.push(\n        <VirtualizedListCellContextProvider\n          cellKey={this._getFooterCellKey()}\n          key=\"$footer\">\n          <View\n            onLayout={this._onLayoutFooter}\n            style={[\n              inversionStyle,\n              this.props.ListFooterComponentStyle,\n            ]}>\n            {\n              // $FlowFixMe[incompatible-type] - Typing ReactNativeComponent revealed errors\n              element\n            }\n          </View>\n        </VirtualizedListCellContextProvider>,\n      );\n    }\n\n    // 4. Render the ScrollView\n    const scrollProps = {\n      ...this.props,\n      onContentSizeChange: this._onContentSizeChange,\n      onLayout: this._onLayout,\n      onScroll: this._onScroll,\n      onScrollBeginDrag: this._onScrollBeginDrag,\n      onScrollEndDrag: this._onScrollEndDrag,\n      onMomentumScrollBegin: this._onMomentumScrollBegin,\n      onMomentumScrollEnd: this._onMomentumScrollEnd,\n      scrollEventThrottle: scrollEventThrottleOrDefault(\n        this.props.scrollEventThrottle,\n      ), // TODO: Android support\n      invertStickyHeaders:\n        this.props.invertStickyHeaders !== undefined\n          ? this.props.invertStickyHeaders\n          : this.props.inverted,\n      stickyHeaderIndices,\n      style: inversionStyle\n        ? [inversionStyle, this.props.style]\n        : this.props.style,\n    };\n\n    this._hasMore = this.state.cellsAroundViewport.last < itemCount - 1;\n\n    const innerRet = (\n      <VirtualizedListContextProvider\n        value={{\n          cellKey: null,\n          getScrollMetrics: this._getScrollMetrics,\n          horizontal: horizontalOrDefault(this.props.horizontal),\n          getOutermostParentListRef: this._getOutermostParentListRef,\n          registerAsNestedChild: this._registerAsNestedChild,\n          unregisterAsNestedChild: this._unregisterAsNestedChild,\n        }}>\n        {React.cloneElement(\n          (\n            this.props.renderScrollComponent ||\n            this._defaultRenderScrollComponent\n          )(scrollProps),\n          {\n            ref: this._captureScrollRef,\n          },\n          cells,\n        )}\n      </VirtualizedListContextProvider>\n    );\n    let ret: React.Node = innerRet;\n    /* https://github.com/necolas/react-native-web/issues/2239: Re-enable when ScrollView.Context.Consumer is available.\n    if (__DEV__) {\n      ret = (\n        <ScrollView.Context.Consumer>\n          {scrollContext => {\n            if (\n              scrollContext != null &&\n              !scrollContext.horizontal ===\n                !horizontalOrDefault(this.props.horizontal) &&\n              !this._hasWarned.nesting &&\n              this.context == null &&\n              this.props.scrollEnabled !== false\n            ) {\n              // TODO (T46547044): use React.warn once 16.9 is sync'd: https://github.com/facebook/react/pull/15170\n              console.error(\n                'VirtualizedLists should never be nested inside plain ScrollViews with the same ' +\n                  'orientation because it can break windowing and other functionality - use another ' +\n                  'VirtualizedList-backed container instead.',\n              );\n              this._hasWarned.nesting = true;\n            }\n            return innerRet;\n          }}\n        </ScrollView.Context.Consumer>\n      );\n    }*/\n    if (this.props.debug) {\n      return (\n        <View style={styles.debug}>\n          {ret}\n          {this._renderDebugOverlay()}\n        </View>\n      );\n    } else {\n      return ret;\n    }\n  }\n\n  componentDidUpdate(prevProps: Props) {\n    const {data, extraData} = this.props;\n    if (data !== prevProps.data || extraData !== prevProps.extraData) {\n      // clear the viewableIndices cache to also trigger\n      // the onViewableItemsChanged callback with the new data\n      this._viewabilityTuples.forEach(tuple => {\n        tuple.viewabilityHelper.resetViewableIndices();\n      });\n    }\n    // The `this._hiPriInProgress` is guaranteeing a hiPri cell update will only happen\n    // once per fiber update. The `_scheduleCellsToRenderUpdate` will set it to true\n    // if a hiPri update needs to perform. If `componentDidUpdate` is triggered with\n    // `this._hiPriInProgress=true`, means it's triggered by the hiPri update. The\n    // `_scheduleCellsToRenderUpdate` will check this condition and not perform\n    // another hiPri update.\n    const hiPriInProgress = this._hiPriInProgress;\n    this._scheduleCellsToRenderUpdate();\n    // Make sure setting `this._hiPriInProgress` back to false after `componentDidUpdate`\n    // is triggered with `this._hiPriInProgress = true`\n    if (hiPriInProgress) {\n      this._hiPriInProgress = false;\n    }\n  }\n\n  _averageCellLength = 0;\n  _cellRefs: {[string]: null | CellRenderer<any>} = {};\n  _fillRateHelper: FillRateHelper;\n  _frames: {\n    [string]: {\n      inLayout?: boolean,\n      index: number,\n      length: number,\n      offset: number,\n    },\n  } = {};\n  _footerLength = 0;\n  // Used for preventing scrollToIndex from being called multiple times for initialScrollIndex\n  _hasTriggeredInitialScrollToIndex = false;\n  _hasInteracted = false;\n  _hasMore = false;\n  _hasWarned: {[string]: boolean} = {};\n  _headerLength = 0;\n  _hiPriInProgress: boolean = false; // flag to prevent infinite hiPri cell limit update\n  _highestMeasuredFrameIndex = 0;\n  _indicesToKeys: Map<number, string> = new Map();\n  _lastFocusedCellKey: ?string = null;\n  _nestedChildLists: ChildListCollection<VirtualizedList> =\n    new ChildListCollection();\n  _offsetFromParentVirtualizedList: number = 0;\n  _prevParentOffset: number = 0;\n  // $FlowFixMe[missing-local-annot]\n  _scrollMetrics = {\n    contentLength: 0,\n    dOffset: 0,\n    dt: 10,\n    offset: 0,\n    timestamp: 0,\n    velocity: 0,\n    visibleLength: 0,\n    zoomScale: 1,\n  };\n  _scrollRef: ?React.ElementRef<any> = null;\n  _sentStartForContentLength = 0;\n  _sentEndForContentLength = 0;\n  _totalCellLength = 0;\n  _totalCellsMeasured = 0;\n  _updateCellsToRenderBatcher: Batchinator;\n  _viewabilityTuples: Array<ViewabilityHelperCallbackTuple> = [];\n\n  /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's\n   * LTI update could not be added via codemod */\n  _captureScrollRef = ref => {\n    this._scrollRef = ref;\n  };\n\n  _computeBlankness() {\n    this._fillRateHelper.computeBlankness(\n      this.props,\n      this.state.cellsAroundViewport,\n      this._scrollMetrics,\n    );\n  }\n\n  /* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's\n   * LTI update could not be added via codemod */\n  _defaultRenderScrollComponent = props => {\n    const onRefresh = props.onRefresh;\n    if (this._isNestedWithSameOrientation()) {\n      // $FlowFixMe[prop-missing] - Typing ReactNativeComponent revealed errors\n      return <View {...props} />;\n    } else if (onRefresh) {\n      invariant(\n        typeof props.refreshing === 'boolean',\n        '`refreshing` prop must be set as a boolean in order to use `onRefresh`, but got `' +\n          JSON.stringify(props.refreshing ?? 'undefined') +\n          '`',\n      );\n      return (\n        // $FlowFixMe[prop-missing] Invalid prop usage\n        // $FlowFixMe[incompatible-use]\n        <ScrollView\n          {...props}\n          refreshControl={\n            props.refreshControl == null ? (\n              <RefreshControl\n                // $FlowFixMe[incompatible-type]\n                refreshing={props.refreshing}\n                onRefresh={onRefresh}\n                progressViewOffset={props.progressViewOffset}\n              />\n            ) : (\n              props.refreshControl\n            )\n          }\n        />\n      );\n    } else {\n      // $FlowFixMe[prop-missing] Invalid prop usage\n      // $FlowFixMe[incompatible-use]\n      return <ScrollView {...props} />;\n    }\n  };\n\n  _onCellLayout = (e: LayoutEvent, cellKey: string, index: number): void => {\n    const layout = e.nativeEvent.layout;\n    const next = {\n      offset: this._selectOffset(layout),\n      length: this._selectLength(layout),\n      index,\n      inLayout: true,\n    };\n    const curr = this._frames[cellKey];\n    if (\n      !curr ||\n      next.offset !== curr.offset ||\n      next.length !== curr.length ||\n      index !== curr.index\n    ) {\n      this._totalCellLength += next.length - (curr ? curr.length : 0);\n      this._totalCellsMeasured += curr ? 0 : 1;\n      this._averageCellLength =\n        this._totalCellLength / this._totalCellsMeasured;\n      this._frames[cellKey] = next;\n      this._highestMeasuredFrameIndex = Math.max(\n        this._highestMeasuredFrameIndex,\n        index,\n      );\n      this._scheduleCellsToRenderUpdate();\n    } else {\n      this._frames[cellKey].inLayout = true;\n    }\n\n    this._triggerRemeasureForChildListsInCell(cellKey);\n\n    this._computeBlankness();\n    this._updateViewableItems(this.props, this.state.cellsAroundViewport);\n  };\n\n  _onCellFocusCapture(cellKey: string) {\n    this._lastFocusedCellKey = cellKey;\n    this._updateCellsToRender();\n  }\n\n  _onCellUnmount = (cellKey: string) => {\n    delete this._cellRefs[cellKey];\n    const curr = this._frames[cellKey];\n    if (curr) {\n      this._frames[cellKey] = {...curr, inLayout: false};\n    }\n  };\n\n  _triggerRemeasureForChildListsInCell(cellKey: string): void {\n    this._nestedChildLists.forEachInCell(cellKey, childList => {\n      childList.measureLayoutRelativeToContainingList();\n    });\n  }\n\n  measureLayoutRelativeToContainingList(): void {\n    // TODO (T35574538): findNodeHandle sometimes crashes with \"Unable to find\n    // node on an unmounted component\" during scrolling\n    try {\n      if (!this._scrollRef) {\n        return;\n      }\n      // We are assuming that getOutermostParentListRef().getScrollRef()\n      // is a non-null reference to a ScrollView\n      this._scrollRef.measureLayout(\n        this.context.getOutermostParentListRef().getScrollRef(),\n        (x, y, width, height) => {\n          this._offsetFromParentVirtualizedList = this._selectOffset({x, y});\n          this._scrollMetrics.contentLength = this._selectLength({\n            width,\n            height,\n          });\n          const scrollMetrics = this._convertParentScrollMetrics(\n            this.context.getScrollMetrics(),\n          );\n\n          const metricsChanged =\n            this._scrollMetrics.visibleLength !== scrollMetrics.visibleLength ||\n            this._scrollMetrics.offset !== scrollMetrics.offset;\n\n          if (metricsChanged) {\n            this._scrollMetrics.visibleLength = scrollMetrics.visibleLength;\n            this._scrollMetrics.offset = scrollMetrics.offset;\n\n            // If metrics of the scrollView changed, then we triggered remeasure for child list\n            // to ensure VirtualizedList has the right information.\n            this._nestedChildLists.forEach(childList => {\n              childList.measureLayoutRelativeToContainingList();\n            });\n          }\n        },\n        error => {\n          console.warn(\n            \"VirtualizedList: Encountered an error while measuring a list's\" +\n              ' offset from its containing VirtualizedList.',\n          );\n        },\n      );\n    } catch (error) {\n      console.warn(\n        'measureLayoutRelativeToContainingList threw an error',\n        error.stack,\n      );\n    }\n  }\n\n  _onLayout = (e: LayoutEvent) => {\n    if (this._isNestedWithSameOrientation()) {\n      // Need to adjust our scroll metrics to be relative to our containing\n      // VirtualizedList before we can make claims about list item viewability\n      this.measureLayoutRelativeToContainingList();\n    } else {\n      this._scrollMetrics.visibleLength = this._selectLength(\n        e.nativeEvent.layout,\n      );\n    }\n    this.props.onLayout && this.props.onLayout(e);\n    this._scheduleCellsToRenderUpdate();\n    this._maybeCallOnEdgeReached();\n  };\n\n  _onLayoutEmpty = (e: LayoutEvent) => {\n    this.props.onLayout && this.props.onLayout(e);\n  };\n\n  _getFooterCellKey(): string {\n    return this._getCellKey() + '-footer';\n  }\n\n  _onLayoutFooter = (e: LayoutEvent) => {\n    this._triggerRemeasureForChildListsInCell(this._getFooterCellKey());\n    this._footerLength = this._selectLength(e.nativeEvent.layout);\n  };\n\n  _onLayoutHeader = (e: LayoutEvent) => {\n    this._headerLength = this._selectLength(e.nativeEvent.layout);\n  };\n\n  // $FlowFixMe[missing-local-annot]\n  _renderDebugOverlay() {\n    const normalize =\n      this._scrollMetrics.visibleLength /\n      (this._scrollMetrics.contentLength || 1);\n    const framesInLayout = [];\n    const itemCount = this.props.getItemCount(this.props.data);\n    for (let ii = 0; ii < itemCount; ii++) {\n      const frame = this.__getFrameMetricsApprox(ii, this.props);\n      /* $FlowFixMe[prop-missing] (>=0.68.0 site=react_native_fb) This comment\n       * suppresses an error found when Flow v0.68 was deployed. To see the\n       * error delete this comment and run Flow. */\n      if (frame.inLayout) {\n        framesInLayout.push(frame);\n      }\n    }\n    const windowTop = this.__getFrameMetricsApprox(\n      this.state.cellsAroundViewport.first,\n      this.props,\n    ).offset;\n    const frameLast = this.__getFrameMetricsApprox(\n      this.state.cellsAroundViewport.last,\n      this.props,\n    );\n    const windowLen = frameLast.offset + frameLast.length - windowTop;\n    const visTop = this._scrollMetrics.offset;\n    const visLen = this._scrollMetrics.visibleLength;\n\n    return (\n      <View style={[styles.debugOverlayBase, styles.debugOverlay]}>\n        {framesInLayout.map((f, ii) => (\n          <View\n            key={'f' + ii}\n            style={[\n              styles.debugOverlayBase,\n              styles.debugOverlayFrame,\n              {\n                top: f.offset * normalize,\n                height: f.length * normalize,\n              },\n            ]}\n          />\n        ))}\n        <View\n          style={[\n            styles.debugOverlayBase,\n            styles.debugOverlayFrameLast,\n            {\n              top: windowTop * normalize,\n              height: windowLen * normalize,\n            },\n          ]}\n        />\n        <View\n          style={[\n            styles.debugOverlayBase,\n            styles.debugOverlayFrameVis,\n            {\n              top: visTop * normalize,\n              height: visLen * normalize,\n            },\n          ]}\n        />\n      </View>\n    );\n  }\n\n  _selectLength(\n    metrics: $ReadOnly<{\n      height: number,\n      width: number,\n      ...\n    }>,\n  ): number {\n    return !horizontalOrDefault(this.props.horizontal)\n      ? metrics.height\n      : metrics.width;\n  }\n\n  _selectOffset(\n    metrics: $ReadOnly<{\n      x: number,\n      y: number,\n      ...\n    }>,\n  ): number {\n    return !horizontalOrDefault(this.props.horizontal) ? metrics.y : metrics.x;\n  }\n\n  _maybeCallOnEdgeReached() {\n    const {\n      data,\n      getItemCount,\n      onStartReached,\n      onStartReachedThreshold,\n      onEndReached,\n      onEndReachedThreshold,\n      initialScrollIndex,\n    } = this.props;\n    const {contentLength, visibleLength, offset} = this._scrollMetrics;\n    let distanceFromStart = offset;\n    let distanceFromEnd = contentLength - visibleLength - offset;\n\n    // Especially when oERT is zero it's necessary to 'floor' very small distance values to be 0\n    // since debouncing causes us to not fire this event for every single \"pixel\" we scroll and can thus\n    // be at the edge of the list with a distance approximating 0 but not quite there.\n    if (distanceFromStart < ON_EDGE_REACHED_EPSILON) {\n      distanceFromStart = 0;\n    }\n    if (distanceFromEnd < ON_EDGE_REACHED_EPSILON) {\n      distanceFromEnd = 0;\n    }\n\n    // TODO: T121172172 Look into why we're \"defaulting\" to a threshold of 2px\n    // when oERT is not present (different from 2 viewports used elsewhere)\n    const DEFAULT_THRESHOLD_PX = 2;\n\n    const startThreshold =\n      onStartReachedThreshold != null\n        ? onStartReachedThreshold * visibleLength\n        : DEFAULT_THRESHOLD_PX;\n    const endThreshold =\n      onEndReachedThreshold != null\n        ? onEndReachedThreshold * visibleLength\n        : DEFAULT_THRESHOLD_PX;\n    const isWithinStartThreshold = distanceFromStart <= startThreshold;\n    const isWithinEndThreshold = distanceFromEnd <= endThreshold;\n\n    // First check if the user just scrolled within the end threshold\n    // and call onEndReached only once for a given content length,\n    // and only if onStartReached is not being executed\n    if (\n      onEndReached &&\n      this.state.cellsAroundViewport.last === getItemCount(data) - 1 &&\n      isWithinEndThreshold &&\n      this._scrollMetrics.contentLength !== this._sentEndForContentLength\n    ) {\n      this._sentEndForContentLength = this._scrollMetrics.contentLength;\n      onEndReached({distanceFromEnd});\n    }\n\n    // Next check if the user just scrolled within the start threshold\n    // and call onStartReached only once for a given content length,\n    // and only if onEndReached is not being executed\n    else if (\n      onStartReached != null &&\n      this.state.cellsAroundViewport.first === 0 &&\n      isWithinStartThreshold &&\n      this._scrollMetrics.contentLength !== this._sentStartForContentLength\n    ) {\n      // On initial mount when using initialScrollIndex the offset will be 0 initially\n      // and will trigger an unexpected onStartReached. To avoid this we can use\n      // timestamp to differentiate between the initial scroll metrics and when we actually\n      // received the first scroll event.\n      if (!initialScrollIndex || this._scrollMetrics.timestamp !== 0) {\n        this._sentStartForContentLength = this._scrollMetrics.contentLength;\n        onStartReached({distanceFromStart});\n      }\n    }\n\n    // If the user scrolls away from the start or end and back again,\n    // cause onStartReached or onEndReached to be triggered again\n    else {\n      this._sentStartForContentLength = isWithinStartThreshold\n        ? this._sentStartForContentLength\n        : 0;\n      this._sentEndForContentLength = isWithinEndThreshold\n        ? this._sentEndForContentLength\n        : 0;\n    }\n  }\n\n  _onContentSizeChange = (width: number, height: number) => {\n    if (\n      width > 0 &&\n      height > 0 &&\n      this.props.initialScrollIndex != null &&\n      this.props.initialScrollIndex > 0 &&\n      !this._hasTriggeredInitialScrollToIndex\n    ) {\n      if (this.props.contentOffset == null) {\n        if (\n          this.props.initialScrollIndex <\n          this.props.getItemCount(this.props.data)\n        ) {\n          this.scrollToIndex({\n            animated: false,\n            index: nullthrows(this.props.initialScrollIndex),\n          });\n        } else {\n          this.scrollToEnd({animated: false});\n        }\n      }\n      this._hasTriggeredInitialScrollToIndex = true;\n    }\n    if (this.props.onContentSizeChange) {\n      this.props.onContentSizeChange(width, height);\n    }\n    this._scrollMetrics.contentLength = this._selectLength({height, width});\n    this._scheduleCellsToRenderUpdate();\n    this._maybeCallOnEdgeReached();\n  };\n\n  /* Translates metrics from a scroll event in a parent VirtualizedList into\n   * coordinates relative to the child list.\n   */\n  _convertParentScrollMetrics = (metrics: {\n    visibleLength: number,\n    offset: number,\n    ...\n  }): $FlowFixMe => {\n    // Offset of the top of the nested list relative to the top of its parent's viewport\n    const offset = metrics.offset - this._offsetFromParentVirtualizedList;\n    // Child's visible length is the same as its parent's\n    const visibleLength = metrics.visibleLength;\n    const dOffset = offset - this._scrollMetrics.offset;\n    const contentLength = this._scrollMetrics.contentLength;\n\n    return {\n      visibleLength,\n      contentLength,\n      offset,\n      dOffset,\n    };\n  };\n\n  _onScroll = (e: Object) => {\n    this._nestedChildLists.forEach(childList => {\n      childList._onScroll(e);\n    });\n    if (this.props.onScroll) {\n      this.props.onScroll(e);\n    }\n    const timestamp = e.timeStamp;\n    let visibleLength = this._selectLength(e.nativeEvent.layoutMeasurement);\n    let contentLength = this._selectLength(e.nativeEvent.contentSize);\n    let offset = this._selectOffset(e.nativeEvent.contentOffset);\n    let dOffset = offset - this._scrollMetrics.offset;\n\n    if (this._isNestedWithSameOrientation()) {\n      if (this._scrollMetrics.contentLength === 0) {\n        // Ignore scroll events until onLayout has been called and we\n        // know our offset from our offset from our parent\n        return;\n      }\n      ({visibleLength, contentLength, offset, dOffset} =\n        this._convertParentScrollMetrics({\n          visibleLength,\n          offset,\n        }));\n    }\n\n    const dt = this._scrollMetrics.timestamp\n      ? Math.max(1, timestamp - this._scrollMetrics.timestamp)\n      : 1;\n    const velocity = dOffset / dt;\n\n    if (\n      dt > 500 &&\n      this._scrollMetrics.dt > 500 &&\n      contentLength > 5 * visibleLength &&\n      !this._hasWarned.perf\n    ) {\n      infoLog(\n        'VirtualizedList: You have a large list that is slow to update - make sure your ' +\n          'renderItem function renders components that follow React performance best practices ' +\n          'like PureComponent, shouldComponentUpdate, etc.',\n        {dt, prevDt: this._scrollMetrics.dt, contentLength},\n      );\n      this._hasWarned.perf = true;\n    }\n\n    // For invalid negative values (w/ RTL), set this to 1.\n    const zoomScale = e.nativeEvent.zoomScale < 0 ? 1 : e.nativeEvent.zoomScale;\n    this._scrollMetrics = {\n      contentLength,\n      dt,\n      dOffset,\n      offset,\n      timestamp,\n      velocity,\n      visibleLength,\n      zoomScale,\n    };\n    this._updateViewableItems(this.props, this.state.cellsAroundViewport);\n    if (!this.props) {\n      return;\n    }\n    this._maybeCallOnEdgeReached();\n    if (velocity !== 0) {\n      this._fillRateHelper.activate();\n    }\n    this._computeBlankness();\n    this._scheduleCellsToRenderUpdate();\n  };\n\n  _scheduleCellsToRenderUpdate() {\n    const {first, last} = this.state.cellsAroundViewport;\n    const {offset, visibleLength, velocity} = this._scrollMetrics;\n    const itemCount = this.props.getItemCount(this.props.data);\n    let hiPri = false;\n    const onStartReachedThreshold = onStartReachedThresholdOrDefault(\n      this.props.onStartReachedThreshold,\n    );\n    const onEndReachedThreshold = onEndReachedThresholdOrDefault(\n      this.props.onEndReachedThreshold,\n    );\n    // Mark as high priority if we're close to the start of the first item\n    // But only if there are items before the first rendered item\n    if (first > 0) {\n      const distTop =\n        offset - this.__getFrameMetricsApprox(first, this.props).offset;\n      hiPri =\n        distTop < 0 ||\n        (velocity < -2 &&\n          distTop <\n            getScrollingThreshold(onStartReachedThreshold, visibleLength));\n    }\n    // Mark as high priority if we're close to the end of the last item\n    // But only if there are items after the last rendered item\n    if (!hiPri && last >= 0 && last < itemCount - 1) {\n      const distBottom =\n        this.__getFrameMetricsApprox(last, this.props).offset -\n        (offset + visibleLength);\n      hiPri =\n        distBottom < 0 ||\n        (velocity > 2 &&\n          distBottom <\n            getScrollingThreshold(onEndReachedThreshold, visibleLength));\n    }\n    // Only trigger high-priority updates if we've actually rendered cells,\n    // and with that size estimate, accurately compute how many cells we should render.\n    // Otherwise, it would just render as many cells as it can (of zero dimension),\n    // each time through attempting to render more (limited by maxToRenderPerBatch),\n    // starving the renderer from actually laying out the objects and computing _averageCellLength.\n    // If this is triggered in an `componentDidUpdate` followed by a hiPri cellToRenderUpdate\n    // We shouldn't do another hipri cellToRenderUpdate\n    if (\n      hiPri &&\n      (this._averageCellLength || this.props.getItemLayout) &&\n      !this._hiPriInProgress\n    ) {\n      this._hiPriInProgress = true;\n      // Don't worry about interactions when scrolling quickly; focus on filling content as fast\n      // as possible.\n      this._updateCellsToRenderBatcher.dispose({abort: true});\n      this._updateCellsToRender();\n      return;\n    } else {\n      this._updateCellsToRenderBatcher.schedule();\n    }\n  }\n\n  _onScrollBeginDrag = (e: ScrollEvent): void => {\n    this._nestedChildLists.forEach(childList => {\n      childList._onScrollBeginDrag(e);\n    });\n    this._viewabilityTuples.forEach(tuple => {\n      tuple.viewabilityHelper.recordInteraction();\n    });\n    this._hasInteracted = true;\n    this.props.onScrollBeginDrag && this.props.onScrollBeginDrag(e);\n  };\n\n  _onScrollEndDrag = (e: ScrollEvent): void => {\n    this._nestedChildLists.forEach(childList => {\n      childList._onScrollEndDrag(e);\n    });\n    const {velocity} = e.nativeEvent;\n    if (velocity) {\n      this._scrollMetrics.velocity = this._selectOffset(velocity);\n    }\n    this._computeBlankness();\n    this.props.onScrollEndDrag && this.props.onScrollEndDrag(e);\n  };\n\n  _onMomentumScrollBegin = (e: ScrollEvent): void => {\n    this._nestedChildLists.forEach(childList => {\n      childList._onMomentumScrollBegin(e);\n    });\n    this.props.onMomentumScrollBegin && this.props.onMomentumScrollBegin(e);\n  };\n\n  _onMomentumScrollEnd = (e: ScrollEvent): void => {\n    this._nestedChildLists.forEach(childList => {\n      childList._onMomentumScrollEnd(e);\n    });\n    this._scrollMetrics.velocity = 0;\n    this._computeBlankness();\n    this.props.onMomentumScrollEnd && this.props.onMomentumScrollEnd(e);\n  };\n\n  _updateCellsToRender = () => {\n    this._updateViewableItems(this.props, this.state.cellsAroundViewport);\n\n    this.setState((state, props) => {\n      const cellsAroundViewport = this._adjustCellsAroundViewport(\n        props,\n        state.cellsAroundViewport,\n      );\n      const renderMask = VirtualizedList._createRenderMask(\n        props,\n        cellsAroundViewport,\n        this._getNonViewportRenderRegions(props),\n      );\n\n      if (\n        cellsAroundViewport.first === state.cellsAroundViewport.first &&\n        cellsAroundViewport.last === state.cellsAroundViewport.last &&\n        renderMask.equals(state.renderMask)\n      ) {\n        return null;\n      }\n\n      return {cellsAroundViewport, renderMask};\n    });\n  };\n\n  _createViewToken = (\n    index: number,\n    isViewable: boolean,\n    props: FrameMetricProps,\n    // $FlowFixMe[missing-local-annot]\n  ) => {\n    const {data, getItem} = props;\n    const item = getItem(data, index);\n    return {\n      index,\n      item,\n      key: this._keyExtractor(item, index, props),\n      isViewable,\n    };\n  };\n\n  /**\n   * Gets an approximate offset to an item at a given index. Supports\n   * fractional indices.\n   */\n  _getOffsetApprox = (index: number, props: FrameMetricProps): number => {\n    if (Number.isInteger(index)) {\n      return this.__getFrameMetricsApprox(index, props).offset;\n    } else {\n      const frameMetrics = this.__getFrameMetricsApprox(\n        Math.floor(index),\n        props,\n      );\n      const remainder = index - Math.floor(index);\n      return frameMetrics.offset + remainder * frameMetrics.length;\n    }\n  };\n\n  __getFrameMetricsApprox: (\n    index: number,\n    props: FrameMetricProps,\n  ) => {\n    length: number,\n    offset: number,\n    ...\n  } = (index, props) => {\n    const frame = this._getFrameMetrics(index, props);\n    if (frame && frame.index === index) {\n      // check for invalid frames due to row re-ordering\n      return frame;\n    } else {\n      const {data, getItemCount, getItemLayout} = props;\n      invariant(\n        index >= 0 && index < getItemCount(data),\n        'Tried to get frame for out of range index ' + index,\n      );\n      invariant(\n        !getItemLayout,\n        'Should not have to estimate frames when a measurement metrics function is provided',\n      );\n      return {\n        length: this._averageCellLength,\n        offset: this._averageCellLength * index,\n      };\n    }\n  };\n\n  _getFrameMetrics = (\n    index: number,\n    props: FrameMetricProps,\n  ): ?{\n    length: number,\n    offset: number,\n    index: number,\n    inLayout?: boolean,\n    ...\n  } => {\n    const {data, getItem, getItemCount, getItemLayout} = props;\n    invariant(\n      index >= 0 && index < getItemCount(data),\n      'Tried to get frame for out of range index ' + index,\n    );\n    const item = getItem(data, index);\n    const frame = this._frames[this._keyExtractor(item, index, props)];\n    if (!frame || frame.index !== index) {\n      if (getItemLayout) {\n        /* $FlowFixMe[prop-missing] (>=0.63.0 site=react_native_fb) This comment\n         * suppresses an error found when Flow v0.63 was deployed. To see the error\n         * delete this comment and run Flow. */\n        return getItemLayout(data, index);\n      }\n    }\n    return frame;\n  };\n\n  _getNonViewportRenderRegions = (\n    props: FrameMetricProps,\n  ): $ReadOnlyArray<{\n    first: number,\n    last: number,\n  }> => {\n    // Keep a viewport's worth of content around the last focused cell to allow\n    // random navigation around it without any blanking. E.g. tabbing from one\n    // focused item out of viewport to another.\n    if (\n      !(this._lastFocusedCellKey && this._cellRefs[this._lastFocusedCellKey])\n    ) {\n      return [];\n    }\n\n    const lastFocusedCellRenderer = this._cellRefs[this._lastFocusedCellKey];\n    const focusedCellIndex = lastFocusedCellRenderer.props.index;\n    const itemCount = props.getItemCount(props.data);\n    \n    // The last cell we rendered may be at a new index. Bail if we don't know\n    // where it is.\n    if (\n      focusedCellIndex >= itemCount ||\n      this._keyExtractor(\n        props.getItem(props.data, focusedCellIndex),\n        focusedCellIndex,\n        props,\n      ) !== this._lastFocusedCellKey\n    ) {\n      return [];\n    }\n\n    let first = focusedCellIndex;\n    let heightOfCellsBeforeFocused = 0;\n    for (\n      let i = first - 1;\n      i >= 0 && heightOfCellsBeforeFocused < this._scrollMetrics.visibleLength;\n      i--\n    ) {\n      first--;\n      heightOfCellsBeforeFocused += this.__getFrameMetricsApprox(\n        i,\n        props,\n      ).length;\n    }\n\n    let last = focusedCellIndex;\n    let heightOfCellsAfterFocused = 0;\n    for (\n      let i = last + 1;\n      i < itemCount &&\n      heightOfCellsAfterFocused < this._scrollMetrics.visibleLength;\n      i++\n    ) {\n      last++;\n      heightOfCellsAfterFocused += this.__getFrameMetricsApprox(\n        i,\n        props,\n      ).length;\n    }\n\n    return [{first, last}];\n  };\n\n  _updateViewableItems(\n    props: FrameMetricProps,\n    cellsAroundViewport: {first: number, last: number},\n  ) {\n    this._viewabilityTuples.forEach(tuple => {\n      tuple.viewabilityHelper.onUpdate(\n        props,\n        this._scrollMetrics.offset,\n        this._scrollMetrics.visibleLength,\n        this._getFrameMetrics,\n        this._createViewToken,\n        tuple.onViewableItemsChanged,\n        cellsAroundViewport,\n      );\n    });\n  }\n}\n\nconst styles = StyleSheet.create({\n  verticallyInverted: {\n    transform: 'scaleY(-1)',\n  },\n  horizontallyInverted: {\n    transform: 'scaleX(-1)',\n  },\n  debug: {\n    flex: 1,\n  },\n  debugOverlayBase: {\n    position: 'absolute',\n    top: 0,\n    right: 0,\n  },\n  debugOverlay: {\n    bottom: 0,\n    width: 20,\n    borderColor: 'blue',\n    borderWidth: 1,\n  },\n  debugOverlayFrame: {\n    left: 0,\n    backgroundColor: 'orange',\n  },\n  debugOverlayFrameLast: {\n    left: 0,\n    borderColor: 'green',\n    borderWidth: 2,\n  },\n  debugOverlayFrameVis: {\n    left: 0,\n    borderColor: 'red',\n    borderWidth: 2,\n  },\n});\n\nexport default VirtualizedList;"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/VirtualizedSectionList/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow\n * @format\n */\n\nimport type {ViewToken} from '../ViewabilityHelper';\nimport View from '../../../exports/View';\nimport VirtualizedList from '../VirtualizedList';\nimport {keyExtractor as defaultKeyExtractor} from '../VirtualizeUtils';\nimport invariant from 'fbjs/lib/invariant';\nimport * as React from 'react';\n\ntype Item = any;\n\nexport type SectionBase<SectionItemT> = {\n  /**\n   * The data for rendering items in this section.\n   */\n  data: $ReadOnlyArray<SectionItemT>,\n  /**\n   * Optional key to keep track of section re-ordering. If you don't plan on re-ordering sections,\n   * the array index will be used by default.\n   */\n  key?: string,\n  // Optional props will override list-wide props just for this section.\n  renderItem?: ?(info: {\n    item: SectionItemT,\n    index: number,\n    section: SectionBase<SectionItemT>,\n    separators: {\n      highlight: () => void,\n      unhighlight: () => void,\n      updateProps: (select: 'leading' | 'trailing', newProps: Object) => void,\n      ...\n    },\n    ...\n  }) => null | React.Element<any>,\n  ItemSeparatorComponent?: ?React.ComponentType<any>,\n  keyExtractor?: (item: SectionItemT, index?: ?number) => string,\n  ...\n};\n\ntype RequiredProps<SectionT: SectionBase<any>> = {|\n  sections: $ReadOnlyArray<SectionT>,\n|};\n\ntype OptionalProps<SectionT: SectionBase<any>> = {|\n  /**\n   * Default renderer for every item in every section.\n   */\n  renderItem?: (info: {\n    item: Item,\n    index: number,\n    section: SectionT,\n    separators: {\n      highlight: () => void,\n      unhighlight: () => void,\n      updateProps: (select: 'leading' | 'trailing', newProps: Object) => void,\n      ...\n    },\n    ...\n  }) => null | React.Element<any>,\n  /**\n   * Rendered at the top of each section. These stick to the top of the `ScrollView` by default on\n   * iOS. See `stickySectionHeadersEnabled`.\n   */\n  renderSectionHeader?: ?(info: {\n    section: SectionT,\n    ...\n  }) => null | React.Element<any>,\n  /**\n   * Rendered at the bottom of each section.\n   */\n  renderSectionFooter?: ?(info: {\n    section: SectionT,\n    ...\n  }) => null | React.Element<any>,\n  /**\n   * Rendered at the top and bottom of each section (note this is different from\n   * `ItemSeparatorComponent` which is only rendered between items). These are intended to separate\n   * sections from the headers above and below and typically have the same highlight response as\n   * `ItemSeparatorComponent`. Also receives `highlighted`, `[leading/trailing][Item/Separator]`,\n   * and any custom props from `separators.updateProps`.\n   */\n  SectionSeparatorComponent?: ?React.ComponentType<any>,\n  /**\n   * Makes section headers stick to the top of the screen until the next one pushes it off. Only\n   * enabled by default on iOS because that is the platform standard there.\n   */\n  stickySectionHeadersEnabled?: boolean,\n  onEndReached?: ?({distanceFromEnd: number, ...}) => void,\n|};\n\ntype VirtualizedListProps = React.ElementConfig<typeof VirtualizedList>;\n\nexport type Props<SectionT> = {|\n  ...RequiredProps<SectionT>,\n  ...OptionalProps<SectionT>,\n  ...$Diff<\n    VirtualizedListProps,\n    {\n      renderItem: $PropertyType<VirtualizedListProps, 'renderItem'>,\n      data: $PropertyType<VirtualizedListProps, 'data'>,\n      ...\n    },\n  >,\n|};\nexport type ScrollToLocationParamsType = {|\n  animated?: ?boolean,\n  itemIndex: number,\n  sectionIndex: number,\n  viewOffset?: number,\n  viewPosition?: number,\n|};\n\ntype State = {childProps: VirtualizedListProps, ...};\n\n/**\n * Right now this just flattens everything into one list and uses VirtualizedList under the\n * hood. The only operation that might not scale well is concatting the data arrays of all the\n * sections when new props are received, which should be plenty fast for up to ~10,000 items.\n */\nclass VirtualizedSectionList<\n  SectionT: SectionBase<any>,\n> extends React.PureComponent<Props<SectionT>, State> {\n  scrollToLocation(params: ScrollToLocationParamsType) {\n    let index = params.itemIndex;\n    for (let i = 0; i < params.sectionIndex; i++) {\n      index += this.props.getItemCount(this.props.sections[i].data) + 2;\n    }\n    let viewOffset = params.viewOffset || 0;\n    if (this._listRef == null) {\n      return;\n    }\n    if (params.itemIndex > 0 && this.props.stickySectionHeadersEnabled) {\n      const frame = this._listRef.__getFrameMetricsApprox(\n        index - params.itemIndex,\n        this._listRef.props,\n      );\n      viewOffset += frame.length;\n    }\n    const toIndexParams = {\n      ...params,\n      viewOffset,\n      index,\n    };\n    // $FlowFixMe[incompatible-use]\n    this._listRef.scrollToIndex(toIndexParams);\n  }\n\n  getListRef(): ?React.ElementRef<typeof VirtualizedList> {\n    return this._listRef;\n  }\n\n  render(): React.Node {\n    const {\n      ItemSeparatorComponent, // don't pass through, rendered with renderItem\n      SectionSeparatorComponent,\n      renderItem: _renderItem,\n      renderSectionFooter,\n      renderSectionHeader,\n      sections: _sections,\n      stickySectionHeadersEnabled,\n      ...passThroughProps\n    } = this.props;\n\n    const listHeaderOffset = this.props.ListHeaderComponent ? 1 : 0;\n\n    const stickyHeaderIndices = this.props.stickySectionHeadersEnabled\n      ? ([]: Array<number>)\n      : undefined;\n\n    let itemCount = 0;\n    for (const section of this.props.sections) {\n      // Track the section header indices\n      if (stickyHeaderIndices != null) {\n        stickyHeaderIndices.push(itemCount + listHeaderOffset);\n      }\n\n      // Add two for the section header and footer.\n      itemCount += 2;\n      itemCount += this.props.getItemCount(section.data);\n    }\n    const renderItem = this._renderItem(itemCount);\n\n    return (\n      <VirtualizedList\n        {...passThroughProps}\n        keyExtractor={this._keyExtractor}\n        stickyHeaderIndices={stickyHeaderIndices}\n        renderItem={renderItem}\n        data={this.props.sections}\n        getItem={(sections, index) =>\n          this._getItem(this.props, sections, index)\n        }\n        getItemCount={() => itemCount}\n        onViewableItemsChanged={\n          this.props.onViewableItemsChanged\n            ? this._onViewableItemsChanged\n            : undefined\n        }\n        ref={this._captureRef}\n      />\n    );\n  }\n\n  _getItem(\n    props: Props<SectionT>,\n    sections: ?$ReadOnlyArray<Item>,\n    index: number,\n  ): ?Item {\n    if (!sections) {\n      return null;\n    }\n    let itemIdx = index - 1;\n    for (let i = 0; i < sections.length; i++) {\n      const section = sections[i];\n      const sectionData = section.data;\n      const itemCount = props.getItemCount(sectionData);\n      if (itemIdx === -1 || itemIdx === itemCount) {\n        // We intend for there to be overflow by one on both ends of the list.\n        // This will be for headers and footers. When returning a header or footer\n        // item the section itself is the item.\n        return section;\n      } else if (itemIdx < itemCount) {\n        // If we are in the bounds of the list's data then return the item.\n        return props.getItem(sectionData, itemIdx);\n      } else {\n        itemIdx -= itemCount + 2; // Add two for the header and footer\n      }\n    }\n    return null;\n  }\n\n  // $FlowFixMe[missing-local-annot]\n  _keyExtractor = (item: Item, index: number) => {\n    const info = this._subExtractor(index);\n    return (info && info.key) || String(index);\n  };\n\n  _subExtractor(index: number): ?{\n    section: SectionT,\n    // Key of the section or combined key for section + item\n    key: string,\n    // Relative index within the section\n    index: ?number,\n    // True if this is the section header\n    header?: ?boolean,\n    leadingItem?: ?Item,\n    leadingSection?: ?SectionT,\n    trailingItem?: ?Item,\n    trailingSection?: ?SectionT,\n    ...\n  } {\n    let itemIndex = index;\n    const {getItem, getItemCount, keyExtractor, sections} = this.props;\n    for (let i = 0; i < sections.length; i++) {\n      const section = sections[i];\n      const sectionData = section.data;\n      const key = section.key || String(i);\n      itemIndex -= 1; // The section adds an item for the header\n      if (itemIndex >= getItemCount(sectionData) + 1) {\n        itemIndex -= getItemCount(sectionData) + 1; // The section adds an item for the footer.\n      } else if (itemIndex === -1) {\n        return {\n          section,\n          key: key + ':header',\n          index: null,\n          header: true,\n          trailingSection: sections[i + 1],\n        };\n      } else if (itemIndex === getItemCount(sectionData)) {\n        return {\n          section,\n          key: key + ':footer',\n          index: null,\n          header: false,\n          trailingSection: sections[i + 1],\n        };\n      } else {\n        const extractor =\n          section.keyExtractor || keyExtractor || defaultKeyExtractor;\n        return {\n          section,\n          key:\n            key + ':' + extractor(getItem(sectionData, itemIndex), itemIndex),\n          index: itemIndex,\n          leadingItem: getItem(sectionData, itemIndex - 1),\n          leadingSection: sections[i - 1],\n          trailingItem: getItem(sectionData, itemIndex + 1),\n          trailingSection: sections[i + 1],\n        };\n      }\n    }\n  }\n\n  _convertViewable = (viewable: ViewToken): ?ViewToken => {\n    invariant(viewable.index != null, 'Received a broken ViewToken');\n    const info = this._subExtractor(viewable.index);\n    if (!info) {\n      return null;\n    }\n    const keyExtractorWithNullableIndex = info.section.keyExtractor;\n    const keyExtractorWithNonNullableIndex =\n      this.props.keyExtractor || defaultKeyExtractor;\n    const key =\n      keyExtractorWithNullableIndex != null\n        ? keyExtractorWithNullableIndex(viewable.item, info.index)\n        : keyExtractorWithNonNullableIndex(viewable.item, info.index ?? 0);\n\n    return {\n      ...viewable,\n      index: info.index,\n      key,\n      section: info.section,\n    };\n  };\n\n  _onViewableItemsChanged = ({\n    viewableItems,\n    changed,\n  }: {\n    viewableItems: Array<ViewToken>,\n    changed: Array<ViewToken>,\n    ...\n  }) => {\n    const onViewableItemsChanged = this.props.onViewableItemsChanged;\n    if (onViewableItemsChanged != null) {\n      onViewableItemsChanged({\n        viewableItems: viewableItems\n          .map(this._convertViewable, this)\n          .filter(Boolean),\n        changed: changed.map(this._convertViewable, this).filter(Boolean),\n      });\n    }\n  };\n\n  _renderItem =\n    (listItemCount: number): $FlowFixMe =>\n    // eslint-disable-next-line react/no-unstable-nested-components\n    ({item, index}: {item: Item, index: number, ...}) => {\n      const info = this._subExtractor(index);\n      if (!info) {\n        return null;\n      }\n      const infoIndex = info.index;\n      if (infoIndex == null) {\n        const {section} = info;\n        if (info.header === true) {\n          const {renderSectionHeader} = this.props;\n          return renderSectionHeader ? renderSectionHeader({section}) : null;\n        } else {\n          const {renderSectionFooter} = this.props;\n          return renderSectionFooter ? renderSectionFooter({section}) : null;\n        }\n      } else {\n        const renderItem = info.section.renderItem || this.props.renderItem;\n        const SeparatorComponent = this._getSeparatorComponent(\n          index,\n          info,\n          listItemCount,\n        );\n        invariant(renderItem, 'no renderItem!');\n        return (\n          <ItemWithSeparator\n            SeparatorComponent={SeparatorComponent}\n            LeadingSeparatorComponent={\n              infoIndex === 0 ? this.props.SectionSeparatorComponent : undefined\n            }\n            cellKey={info.key}\n            index={infoIndex}\n            item={item}\n            leadingItem={info.leadingItem}\n            leadingSection={info.leadingSection}\n            prevCellKey={(this._subExtractor(index - 1) || {}).key}\n            // Callback to provide updateHighlight for this item\n            setSelfHighlightCallback={this._setUpdateHighlightFor}\n            setSelfUpdatePropsCallback={this._setUpdatePropsFor}\n            // Provide child ability to set highlight/updateProps for previous item using prevCellKey\n            updateHighlightFor={this._updateHighlightFor}\n            updatePropsFor={this._updatePropsFor}\n            renderItem={renderItem}\n            section={info.section}\n            trailingItem={info.trailingItem}\n            trailingSection={info.trailingSection}\n            inverted={!!this.props.inverted}\n          />\n        );\n      }\n    };\n\n  _updatePropsFor = (cellKey: string, value: any) => {\n    const updateProps = this._updatePropsMap[cellKey];\n    if (updateProps != null) {\n      updateProps(value);\n    }\n  };\n\n  _updateHighlightFor = (cellKey: string, value: boolean) => {\n    const updateHighlight = this._updateHighlightMap[cellKey];\n    if (updateHighlight != null) {\n      updateHighlight(value);\n    }\n  };\n\n  _setUpdateHighlightFor = (\n    cellKey: string,\n    updateHighlightFn: ?(boolean) => void,\n  ) => {\n    if (updateHighlightFn != null) {\n      this._updateHighlightMap[cellKey] = updateHighlightFn;\n    } else {\n      // $FlowFixMe[prop-missing]\n      delete this._updateHighlightFor[cellKey];\n    }\n  };\n\n  _setUpdatePropsFor = (cellKey: string, updatePropsFn: ?(boolean) => void) => {\n    if (updatePropsFn != null) {\n      this._updatePropsMap[cellKey] = updatePropsFn;\n    } else {\n      delete this._updatePropsMap[cellKey];\n    }\n  };\n\n  _getSeparatorComponent(\n    index: number,\n    info?: ?Object,\n    listItemCount: number,\n  ): ?React.ComponentType<any> {\n    info = info || this._subExtractor(index);\n    if (!info) {\n      return null;\n    }\n    const ItemSeparatorComponent =\n      info.section.ItemSeparatorComponent || this.props.ItemSeparatorComponent;\n    const {SectionSeparatorComponent} = this.props;\n    const isLastItemInList = index === listItemCount - 1;\n    const isLastItemInSection =\n      info.index === this.props.getItemCount(info.section.data) - 1;\n    if (SectionSeparatorComponent && isLastItemInSection) {\n      return SectionSeparatorComponent;\n    }\n    if (ItemSeparatorComponent && !isLastItemInSection && !isLastItemInList) {\n      return ItemSeparatorComponent;\n    }\n    return null;\n  }\n\n  _updateHighlightMap: {[string]: (boolean) => void} = {};\n  _updatePropsMap: {[string]: void | (boolean => void)} = {};\n  _listRef: ?React.ElementRef<typeof VirtualizedList>;\n  _captureRef = (ref: null | React$ElementRef<Class<VirtualizedList>>) => {\n    this._listRef = ref;\n  };\n}\n\ntype ItemWithSeparatorCommonProps = $ReadOnly<{|\n  leadingItem: ?Item,\n  leadingSection: ?Object,\n  section: Object,\n  trailingItem: ?Item,\n  trailingSection: ?Object,\n|}>;\n\ntype ItemWithSeparatorProps = $ReadOnly<{|\n  ...ItemWithSeparatorCommonProps,\n  LeadingSeparatorComponent: ?React.ComponentType<any>,\n  SeparatorComponent: ?React.ComponentType<any>,\n  cellKey: string,\n  index: number,\n  item: Item,\n  setSelfHighlightCallback: (\n    cellKey: string,\n    updateFn: ?(boolean) => void,\n  ) => void,\n  setSelfUpdatePropsCallback: (\n    cellKey: string,\n    updateFn: ?(boolean) => void,\n  ) => void,\n  prevCellKey?: ?string,\n  updateHighlightFor: (prevCellKey: string, value: boolean) => void,\n  updatePropsFor: (prevCellKey: string, value: Object) => void,\n  renderItem: Function,\n  inverted: boolean,\n|}>;\n\nfunction ItemWithSeparator(props: ItemWithSeparatorProps): React.Node {\n  const {\n    LeadingSeparatorComponent,\n    // this is the trailing separator and is associated with this item\n    SeparatorComponent,\n    cellKey,\n    prevCellKey,\n    setSelfHighlightCallback,\n    updateHighlightFor,\n    setSelfUpdatePropsCallback,\n    updatePropsFor,\n    item,\n    index,\n    section,\n    inverted,\n  } = props;\n\n  const [leadingSeparatorHiglighted, setLeadingSeparatorHighlighted] =\n    React.useState(false);\n\n  const [separatorHighlighted, setSeparatorHighlighted] = React.useState(false);\n\n  const [leadingSeparatorProps, setLeadingSeparatorProps] = React.useState({\n    leadingItem: props.leadingItem,\n    leadingSection: props.leadingSection,\n    section: props.section,\n    trailingItem: props.item,\n    trailingSection: props.trailingSection,\n  });\n  const [separatorProps, setSeparatorProps] = React.useState({\n    leadingItem: props.item,\n    leadingSection: props.leadingSection,\n    section: props.section,\n    trailingItem: props.trailingItem,\n    trailingSection: props.trailingSection,\n  });\n\n  React.useEffect(() => {\n    setSelfHighlightCallback(cellKey, setSeparatorHighlighted);\n    // $FlowFixMe[incompatible-call]\n    setSelfUpdatePropsCallback(cellKey, setSeparatorProps);\n\n    return () => {\n      setSelfUpdatePropsCallback(cellKey, null);\n      setSelfHighlightCallback(cellKey, null);\n    };\n  }, [\n    cellKey,\n    setSelfHighlightCallback,\n    setSeparatorProps,\n    setSelfUpdatePropsCallback,\n  ]);\n\n  const separators = {\n    highlight: () => {\n      setLeadingSeparatorHighlighted(true);\n      setSeparatorHighlighted(true);\n      if (prevCellKey != null) {\n        updateHighlightFor(prevCellKey, true);\n      }\n    },\n    unhighlight: () => {\n      setLeadingSeparatorHighlighted(false);\n      setSeparatorHighlighted(false);\n      if (prevCellKey != null) {\n        updateHighlightFor(prevCellKey, false);\n      }\n    },\n    updateProps: (\n      select: 'leading' | 'trailing',\n      newProps: $Shape<ItemWithSeparatorCommonProps>,\n    ) => {\n      if (select === 'leading') {\n        if (LeadingSeparatorComponent != null) {\n          setLeadingSeparatorProps({...leadingSeparatorProps, ...newProps});\n        } else if (prevCellKey != null) {\n          // update the previous item's separator\n          updatePropsFor(prevCellKey, {...leadingSeparatorProps, ...newProps});\n        }\n      } else if (select === 'trailing' && SeparatorComponent != null) {\n        setSeparatorProps({...separatorProps, ...newProps});\n      }\n    },\n  };\n  const element = props.renderItem({\n    item,\n    index,\n    section,\n    separators,\n  });\n  const leadingSeparator = LeadingSeparatorComponent != null && (\n    <LeadingSeparatorComponent\n      highlighted={leadingSeparatorHiglighted}\n      {...leadingSeparatorProps}\n    />\n  );\n  const separator = SeparatorComponent != null && (\n    <SeparatorComponent\n      highlighted={separatorHighlighted}\n      {...separatorProps}\n    />\n  );\n  return leadingSeparator || separator ? (\n    <View>\n      {inverted === false ? leadingSeparator : separator}\n      {element}\n      {inverted === false ? separator : leadingSeparator}\n    </View>\n  ) : (\n    element\n  );\n}\n\n/* $FlowFixMe[class-object-subtyping] added when improving typing for this\n * parameters */\n// $FlowFixMe[method-unbinding]\nexport default (VirtualizedSectionList: React.AbstractComponent<\n  React.ElementConfig<typeof VirtualizedSectionList>,\n  $ReadOnly<{\n    getListRef: () => ?React.ElementRef<typeof VirtualizedList>,\n    scrollToLocation: (params: ScrollToLocationParamsType) => void,\n    ...\n  }>,\n>);\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/deepDiffer/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * @flow\n */\n\n'use strict';\n\n/*\n * @returns {bool} true if different, false if equal\n */\nconst deepDiffer = function(\n  one: any,\n  two: any,\n  maxDepth: number = -1,\n): boolean {\n  if (maxDepth === 0) {\n    return true;\n  }\n  if (one === two) {\n    // Short circuit on identical object references instead of traversing them.\n    return false;\n  }\n  if (typeof one === 'function' && typeof two === 'function') {\n    // We consider all functions equal\n    return false;\n  }\n  if (typeof one !== 'object' || one === null) {\n    // Primitives can be directly compared\n    return one !== two;\n  }\n  if (typeof two !== 'object' || two === null) {\n    // We know they are different because the previous case would have triggered\n    // otherwise.\n    return true;\n  }\n  if (one.constructor !== two.constructor) {\n    return true;\n  }\n  if (Array.isArray(one)) {\n    // We know two is also an array because the constructors are equal\n    const len = one.length;\n    if (two.length !== len) {\n      return true;\n    }\n    for (let ii = 0; ii < len; ii++) {\n      if (deepDiffer(one[ii], two[ii], maxDepth - 1)) {\n        return true;\n      }\n    }\n  } else {\n    for (const key in one) {\n      if (deepDiffer(one[key], two[key], maxDepth - 1)) {\n        return true;\n      }\n    }\n    for (const twoKey in two) {\n      // The only case we haven't checked yet is keys that are in two but aren't\n      // in one, which means they are different.\n      if (one[twoKey] === undefined && two[twoKey] !== undefined) {\n        return true;\n      }\n    }\n  }\n  return false;\n};\n\nexport default deepDiffer;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/infoLog/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * @flow strict\n */\n\n'use strict';\n\n/**\n * Intentional info-level logging for clear separation from ad-hoc console debug logging.\n */\nfunction infoLog(...args: Array<mixed>): void {\n  return console.log(...args);\n}\n\nexport default infoLog;\n"
  },
  {
    "path": "packages/react-native-web/src/vendor/react-native/vendor/emitter/EventEmitter.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @flow strict\n * @format\n */\n\nexport interface EventSubscription {\n  remove(): void;\n}\n\nexport interface IEventEmitter<TEventToArgsMap: {...}> {\n  addListener<TEvent: $Keys<TEventToArgsMap>>(\n    eventType: TEvent,\n    listener: (...args: $ElementType<TEventToArgsMap, TEvent>) => mixed,\n    context?: mixed,\n  ): EventSubscription;\n\n  emit<TEvent: $Keys<TEventToArgsMap>>(\n    eventType: TEvent,\n    ...args: $ElementType<TEventToArgsMap, TEvent>\n  ): void;\n\n  removeAllListeners<TEvent: $Keys<TEventToArgsMap>>(eventType?: ?TEvent): void;\n\n  listenerCount<TEvent: $Keys<TEventToArgsMap>>(eventType: TEvent): number;\n}\n\ninterface Registration<TArgs> {\n  +context: mixed;\n  +listener: (...args: TArgs) => mixed;\n  +remove: () => void;\n}\n\ntype Registry<TEventToArgsMap: {...}> = $ObjMap<\n  TEventToArgsMap,\n  <TArgs>(TArgs) => Set<Registration<TArgs>>,\n>;\n\n/**\n * EventEmitter manages listeners and publishes events to them.\n *\n * EventEmitter accepts a single type parameter that defines the valid events\n * and associated listener argument(s).\n *\n * @example\n *\n *   const emitter = new EventEmitter<{\n *     success: [number, string],\n *     error: [Error],\n *   }>();\n *\n *   emitter.on('success', (statusCode, responseText) => {...});\n *   emitter.emit('success', 200, '...');\n *\n *   emitter.on('error', error => {...});\n *   emitter.emit('error', new Error('Resource not found'));\n *\n */\nexport default class EventEmitter<TEventToArgsMap: {...}>\n  implements IEventEmitter<TEventToArgsMap>\n{\n  _registry: Registry<TEventToArgsMap> = {};\n\n  /**\n   * Registers a listener that is called when the supplied event is emitted.\n   * Returns a subscription that has a `remove` method to undo registration.\n   */\n  addListener<TEvent: $Keys<TEventToArgsMap>>(\n    eventType: TEvent,\n    listener: (...args: $ElementType<TEventToArgsMap, TEvent>) => mixed,\n    context: mixed,\n  ): EventSubscription {\n    const registrations = allocate(this._registry, eventType);\n    const registration: Registration<$ElementType<TEventToArgsMap, TEvent>> = {\n      context,\n      listener,\n      remove(): void {\n        registrations.delete(registration);\n      },\n    };\n    registrations.add(registration);\n    return registration;\n  }\n\n  /**\n   * Emits the supplied event. Additional arguments supplied to `emit` will be\n   * passed through to each of the registered listeners.\n   *\n   * If a listener modifies the listeners registered for the same event, those\n   * changes will not be reflected in the current invocation of `emit`.\n   */\n  emit<TEvent: $Keys<TEventToArgsMap>>(\n    eventType: TEvent,\n    ...args: $ElementType<TEventToArgsMap, TEvent>\n  ): void {\n    const registrations: ?Set<\n      Registration<$ElementType<TEventToArgsMap, TEvent>>,\n    > = this._registry[eventType];\n    if (registrations != null) {\n      for (const registration of [...registrations]) {\n        registration.listener.apply(registration.context, args);\n      }\n    }\n  }\n\n  /**\n   * Removes all registered listeners.\n   */\n  removeAllListeners<TEvent: $Keys<TEventToArgsMap>>(\n    eventType?: ?TEvent,\n  ): void {\n    if (eventType == null) {\n      this._registry = {};\n    } else {\n      delete this._registry[eventType];\n    }\n  }\n\n  /**\n   * Returns the number of registered listeners for the supplied event.\n   */\n  listenerCount<TEvent: $Keys<TEventToArgsMap>>(eventType: TEvent): number {\n    const registrations: ?Set<Registration<mixed>> = this._registry[eventType];\n    return registrations == null ? 0 : registrations.size;\n  }\n}\n\nfunction allocate<\n  TEventToArgsMap: {...},\n  TEvent: $Keys<TEventToArgsMap>,\n  TEventArgs: $ElementType<TEventToArgsMap, TEvent>,\n>(\n  registry: Registry<TEventToArgsMap>,\n  eventType: TEvent,\n): Set<Registration<TEventArgs>> {\n  let registrations: ?Set<Registration<TEventArgs>> = registry[eventType];\n  if (registrations == null) {\n    registrations = new Set();\n    registry[eventType] = registrations;\n  }\n  return registrations;\n}\n"
  },
  {
    "path": "packages/react-native-web-docs/.eleventy.js",
    "content": "'use strict';\n\nconst csso = require('csso');\nconst eleventyNavigationPlugin = require('@11ty/eleventy-navigation');\nconst eleventySvgContentsPlugin = require('eleventy-plugin-svg-contents');\nconst eleventySyntaxHighlightPlugin = require('@11ty/eleventy-plugin-syntaxhighlight');\nconst htmlmin = require('html-minifier');\nconst markdown = require('markdown-it');\nconst markdownAnchor = require('markdown-it-anchor');\nconst markdownAttrs = require('markdown-it-attrs');\nconst markdownContainer = require('markdown-it-container');\nconst markdownEmoji = require('markdown-it-emoji');\nconst markdownFootnote = require('markdown-it-footnote');\nconst markdownTasks = require('markdown-it-task-lists');\nconst UglifyJS = require('uglify-es');\n\n/**\n * Markdown plugin\n * Add classes to markdown elements by default\n */\nfunction markdownitTagToClass(md, mapping = {}) {\n  const toArray = (a) => (Array.isArray(a) ? a : [a]);\n  const splitWithSpace = (s) => (s ? s.split(' ') : []);\n\n  function parseTokens(tokens) {\n    tokens.forEach((token) => {\n      if (/(_open$|hr|image)/.test(token.type) && mapping[token.tag]) {\n        const orig = splitWithSpace(token.attrGet('class'));\n        const addition = toArray(mapping[token.tag]);\n        token.attrSet('class', [...orig, ...addition].join(' '));\n      }\n      if (token.children) {\n        parseTokens(token.children);\n      }\n    });\n  }\n  md.core.ruler.push('markdownit-tag-to-class', (state) =>\n    parseTokens(state.tokens)\n  );\n}\n\nmodule.exports = function (eleventyConfig) {\n  // Merge data instead of overriding\n  // https://www.11ty.dev/docs/data-deep-merge/\n  eleventyConfig.setDataDeepMerge(true);\n\n  // PLUGINS -----\n\n  // Eleventy Navigation https://www.11ty.dev/docs/plugins/navigation/\n  eleventyConfig.addPlugin(eleventyNavigationPlugin);\n  // Inline SVG files https://www.npmjs.com/package/eleventy-plugin-svg-contents\n  eleventyConfig.addPlugin(eleventySvgContentsPlugin);\n  // Syntax Highlighting https://www.11ty.dev/docs/plugins/syntaxhighlight/\n  eleventyConfig.addPlugin(eleventySyntaxHighlightPlugin);\n\n  // TRANSFORMS -----\n\n  // Minify HTML output\n  eleventyConfig.addTransform('htmlmin', function (content, outputPath) {\n    if (typeof outputPath === 'string' && outputPath.includes('.html')) {\n      return htmlmin.minify(content, {\n        useShortDoctype: true,\n        removeComments: true,\n        collapseWhitespace: true\n      });\n    }\n    return content;\n  });\n\n  // FILTERS -----\n\n  // Date formatting (human readable)\n  eleventyConfig.addFilter('readableDate', (dateObj) => {\n    const options = { month: 'long', day: 'numeric', year: 'numeric' };\n    return new Intl.DateTimeFormat('en-US', options).format(dateObj);\n  });\n  // Date formatting (machine readable)\n  eleventyConfig.addFilter('machineDate', (dateObj) => {\n    return dateObj.toISOString();\n  });\n  // Minify CSS\n  eleventyConfig.addFilter('cssmin', function (code) {\n    return csso.minify(code).css;\n  });\n  // Minify JS\n  eleventyConfig.addFilter('jsmin', function (code) {\n    const minified = UglifyJS.minify(code);\n    if (minified.error) {\n      console.log('UglifyJS error: ', minified.error);\n      return code;\n    }\n    return minified.code;\n  });\n\n  // SHORTCODES -----\n\n  eleventyConfig.addShortcode('version', function () {\n    return String(Date.now());\n  });\n\n  // PASSTHROUGH -----\n\n  eleventyConfig.addPassthroughCopy('src/static');\n\n  // COLLECTIONS -----\n\n  // Collection of items for navigation\n  eleventyConfig.addCollection('nav', function (collection) {\n    return collection\n      .getAll()\n      .filter(function (item) {\n        return 'eleventyNavigation' in item.data;\n      })\n      .sort((a, b) => {\n        const keyA = a.data.eleventyNavigation.key;\n        const keyB = b.data.eleventyNavigation.key;\n        if (keyA > keyB) {\n          return 1;\n        } else if (keyA < keyB) {\n          return -1;\n        }\n        return 0;\n      });\n  });\n\n  // MARKDOWN -----\n\n  const options = {\n    html: true,\n    breaks: true,\n    linkify: true,\n    typographer: true\n  };\n\n  const markdownLib = markdown(options);\n\n  markdownLib\n    // Customize markdown HTML\n    // .use(markdownitTagToClass, {})\n    // Automatically place anchors next to headings\n    // https://github.com/valeriangalliat/markdown-it-anchor\n    .use(markdownAnchor, {\n      level: [2, 3],\n      permalink: markdownAnchor.permalink.headerLink({ safariReaderFix: true }),\n      // permalinkClass: \"direct-link\",\n      permalinkSymbol: '#'\n    })\n    // Syntax for adding attributes {.class decode=async}\n    // https://github.com/arve0/markdown-it-attrs\n    .use(markdownAttrs, {\n      allowedAttributes: ['class', 'decode', 'height', 'lazy', 'width']\n    })\n    // Custom containers (::: name)\n    // https://github.com/markdown-it/markdown-it-container\n    .use(markdownContainer, 'callout')\n    .use(markdownContainer, 'lead')\n    .use(markdownContainer, 'warning')\n    // Emoji replacement\n    // https://github.com/markdown-it/markdown-it-emoji\n    .use(markdownEmoji)\n    // Add footnotes\n    // https://github.com/markdown-it/markdown-it-footnote\n    .use(markdownFootnote)\n    // Render a task list\n    // https://github.com/revin/markdown-it-task-lists\n    .use(markdownTasks);\n\n  eleventyConfig.setLibrary('md', markdownLib);\n\n  // ELEVENTY CONFIG -----\n\n  return {\n    templateFormats: ['md', 'njk', 'html'],\n    markdownTemplateEngine: 'njk',\n    htmlTemplateEngine: 'njk',\n    dataTemplateEngine: 'njk',\n    passthroughFileCopy: true,\n    dir: {\n      input: './src',\n      includes: 'includes',\n      data: 'data',\n      output: 'dist'\n    },\n    // Matches the GitHub Pages subdirectory of the site (necolas.github.io/react-native-web)\n    pathPrefix: '/react-native-web/'\n  };\n};\n"
  },
  {
    "path": "packages/react-native-web-docs/LICENSE",
    "content": "MIT License\n\nCopyright (c) Nicolas Gallagher.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "packages/react-native-web-docs/README.md",
    "content": "# React Native for Web documentation\n\nMarkdown pages and a static site generator.\n"
  },
  {
    "path": "packages/react-native-web-docs/package.json",
    "content": "{\n  \"private\": true,\n  \"name\": \"react-native-web-docs\",\n  \"version\": \"0.21.2\",\n  \"description\": \"Documentation website for React Native for Web\",\n  \"scripts\": {\n    \"dev\": \"eleventy --serve\",\n    \"build\": \"ELEVENTY_PRODUCTION=true eleventy\",\n    \"debug\": \"DEBUG=* eleventy\"\n  },\n  \"homepage\": \"https://github.com/necolas/react-native-web\",\n  \"devDependencies\": {\n    \"@11ty/eleventy\": \"^1.0.1\",\n    \"@11ty/eleventy-navigation\": \"^0.3.3\",\n    \"@11ty/eleventy-plugin-syntaxhighlight\": \"^4.1.0\",\n    \"csso\": \"^5.0.3\",\n    \"eleventy-plugin-svg-contents\": \"^0.7.0\",\n    \"eleventy-plugin-toc\": \"^1.1.5\",\n    \"html-minifier\": \"^4.0.0\",\n    \"markdown-it\": \"^13.0.1\",\n    \"markdown-it-anchor\": \"^8.6.4\",\n    \"markdown-it-attrs\": \"^4.1.4\",\n    \"markdown-it-container\": \"^3.0.0\",\n    \"markdown-it-emoji\": \"^2.0.2\",\n    \"markdown-it-footnote\": \"^3.0.3\",\n    \"markdown-it-for-inline\": \"^0.1.1\",\n    \"markdown-it-task-lists\": \"^2.1.1\",\n    \"uglify-es\": \"^3.3.9\"\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/data/site.js",
    "content": "const packageJson = require('../../package.json');\n\nmodule.exports = {\n  name: 'React Native for Web',\n  description: '',\n  footer: 'Copyright © Nicolas Gallagher and Meta Platforms, Inc.',\n  url: 'https://necolas.github.io/react-native-web',\n  githubUrl: 'https://github.com/necolas/react-native-web',\n  githubBranch: 'master',\n  packageName: 'react-native-web',\n  packageUrl: 'https://www.npmjs.com/package/react-native-web',\n  packageVersion: packageJson.version,\n\n  enableEditButton: true,\n  enableGithubLink: true\n};\n"
  },
  {
    "path": "packages/react-native-web-docs/src/includes/assets/inline.css",
    "content": "/**\n * Variables\n * --------------------------------------------------------\n */\n\n:root {\n  --docs-spacing-1: 0.25rem;\n  --docs-spacing-2: 0.5rem;\n  --docs-spacing-3: 0.75rem;\n  --docs-spacing-4: 1rem;\n  --docs-spacing-5: 1.25rem;\n  --docs-spacing-6: 1.5rem;\n  --docs-spacing-8: 2rem;\n  --docs-spacing-10: 2.5rem;\n  --docs-spacing-12: 3rem;\n  --docs-spacing-16: 4rem;\n  --docs-spacing-20: 5rem;\n  --docs-spacing-40: 10rem;\n  --docs-spacing-60: 15rem;\n  --docs-spacing-64: 16rem;\n  --docs-spacing-72: 18rem;\n  --docs-spacing-80: 20rem;\n\n  --docs-font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif;\n  --docs-font-size: 14px;\n  --docs-heading-size: 2em;\n  --docs-line-height: 1.5;\n\n  --docs-ring-inset: var(--tw-empty,/*!*/ /*!*/);\n  --docs-ring-offset-width: 0px;\n}\n\n/* Widescreen */\n\n @media (min-width: 1088px) {\n  :root {\n    --docs-font-size: 16px;\n    --docs-heading-size: 2.25em;\n  }\n }\n\n/* Light theme */\n\n@media all {\n  :root {\n    --docs-bg-color: #fff;\n    --docs-border-color: #e5e5e5;\n    --docs-border-color-faint: #e5e5e5;\n    --docs-text-color: #333;\n    --docs-text-color-faint: #6b7280;\n    --docs-heading-color: #111;\n    --docs-link-color: #1977f2;\n    --docs-code-color: #111;\n    --docs-callout-bg-color: #fff3cd;\n    --docs-callout-border-color: #ffd402;\n    --docs-theme-color: #1977f2;\n    --docs-theme-color-faint: #1977f250;\n    --docs-theme-color-faded: #1977f20f;\n\n    --docs-ring-color: rgba(59, 130, 246, 0.5);\n    --docs-ring-offset-color: #fff;\n    --docs-ring-offset-shadow: 0 0 #0000;\n    --docs-ring-shadow: 0 0 #0000;\n\n    --docs-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);\n  }\n}\n\n/* Dark theme */\n\n@media (prefers-color-scheme: dark) {\n  :root {\n    --docs-bg-color: #15202b;\n    --docs-border-color: #26395a;\n    --docs-border-color-faint: #26395a;\n    --docs-text-color: #eee;\n    --docs-text-color-faint: #aaa;\n    --docs-heading-color: #fff;\n    --docs-link-color: #60a6ff;\n    --docs-code-color: #fff;\n    --docs-callout-bg-color: #231f00;\n\n    --docs-ring-color: rgba(59, 130, 246, 0.5);\n    --docs-ring-offset-color: #fff;\n    --docs-ring-offset-shadow: 0 0 #0000;\n    --docs-ring-shadow: 0 0 #0000;\n\n    --docs-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);\n  }\n}\n\n/**\n * Reset\n * --------------------------------------------------------\n */\n\nhtml { font: var(--docs-font-size)/var(--docs-line-height) var(--docs-font-family); }\nbody { background-color: var(--docs-bg-color, transparent); color: var(--docs-text-color, #333); margin: 0; }\nbutton, input { overflow: visible; }\nbutton, select { text-transform: none; }\ncode, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace; }\nhr { box-sizing: content-box; height: 0; overflow: visible; }\nimg { border-style: none; }\nimg, video, svg, iframe { display: block; }\nimg, video { max-width: 100%; height: auto; }\nsvg:not(:root){ overflow: hidden; }\ntable { border-collapse: collapse; }\n:not(:focus-visible) { outline-width: 0; }\na { color: var(--docs-link-color); text-decoration: underline; }\nh1, h2, h3, h4, h5, h6 { color: var(--docs-heading-color); }\n\n/**\n * Core components\n * --------------------------------------------------------\n */\n\n.text {\n  background-color: transparent;\n  border: 0 solid black;\n  box-sizing: border-box;\n  color: var(--docs-text-color);\n  display: inline;\n  font-family: var(--docs-font-family);\n  margin: 0;\n  padding: 0;\n  text-decoration: none;\n  white-space: pre-wrap;\n  word-wrap: break-word;\n}\n\n.view {\n  align-items: stretch;\n  background-color: transparent;\n  border: 0 solid black;\n  box-sizing: border-box;\n  display: flex;\n  flex-basis: auto;\n  flex-direction: column;\n  flex-shrink: 0;\n  margin: 0;\n  min-height: 0;\n  min-width: 0;\n  padding: 0;\n  position: relative;\n  text-decoration: none;\n  z-index: 0;\n}\n\n.emoji {\n  height: 1.2em;\n  margin: 0 0.075em !important;\n  display: inline-block;\n}\n\n/**\n * Website components\n * --------------------------------------------------------\n */\n\n.container {\n  max-width: 760px;\n}\n\n.navigation {\n  left: auto;\n  right: 100%;\n}\n\n.before-middot::before {\n  display: inline-block;\n  content: \"\";\n  width: 3px;\n  height: 3px;\n  background-color: currentColor;\n  border-radius: 9999px;\n  margin: 0 7px 0 -10px;\n  vertical-align: middle;\n}\n\n.prop {\n  margin-top: var(--docs-spacing-5);\n  margin-bottom: var(--docs-spacing-5);\n}\n\n.prop p {\n  margin: 0 !important;\n}\n\n.callout {\n  background-color: var(--docs-callout-bg-color);\n  border-bottom-right-radius: 0.5rem;\n  border-top-right-radius: 0.5rem;\n  border-left: 3px solid var(--docs-callout-border-color);\n  margin: var(--docs-spacing-12) 0 var(--docs-spacing-4);\n  padding: var(--docs-spacing-2) var(--docs-spacing-8);\n}\n\n/**\n * Markdown content\n * --------------------------------------------------------\n */\n\n.markdown {\n  line-height: 1.75;\n  font-size: 1.125rem;\n  word-wrap: break-word;\n}\n\n.markdown a {\n  color: var(--docs-link-color);\n  text-decoration: underline;\n}\n\n.markdown h1 {\n  font-weight: 800;\n  font-size: var(--docs-heading-size);\n  margin: 0 0 var(--docs-spacing-8);\n  line-height: 1.1;\n}\n\n.markdown h2 {\n  font-weight: 700;\n  font-size: 1.5em;\n  margin: var(--docs-spacing-12) 0 var(--docs-spacing-6);\n  line-height: 1.3;\n}\n\n.markdown h2 + * {\n  margin-top: 0;\n}\n\n.markdown h3 {\n  font-weight: 600;\n  font-size: 1.25em;\n  margin: var(--docs-spacing-8) 0 var(--docs-spacing-3);\n  line-height: 1.5;\n}\n\n.markdown h2,\n.markdown h3,\n.markdown h4 {\n  scroll-margin-top: 1em;\n}\n\n.markdown h1:hover .header-anchor,\n.markdown h2:hover .header-anchor,\n.markdown h3:hover .header-anchor {\n  opacity: 1;\n}\n\n.markdown .header-anchor {\n  text-decoration: none;\n}\n\n.markdown .lead {\n  font-size: 1.25em;\n  line-height: 1.5;\n}\n\n.markdown hr {\n  box-sizing: content-box;\n  height: 0;\n  overflow: visible;\n  border: 0;\n  border-top: 1px solid var(--docs-border-color-faint);\n  margin: var(--docs-spacing-12) 0;\n}\n\n.markdown hr + * {\n  margin-top: 0;\n}\n\n.markdown table {\n  border-collapse: collapse;\n  text-indent: 0;\n  border-color: inherit;\n  width: 100%;\n  table-layout: auto;\n  text-align: left;\n  margin-top: 2em;\n  margin-bottom: 2em;\n  font-size: 0.875em;\n  line-height: 1.7;\n}\n\n.markdown thead {\n  font-weight: 600;\n  border-bottom: 1px solid var(--docs-border-color);\n}\n\n.markdown thead th {\n  vertical-align: bottom;\n  padding: 0 0.5em 0.5em;\n}\n\n.markdown thead th:first-child {\n  padding-left: 0;\n}\n\n.markdown tbody tr {\n  border-bottom: 1px solid var(--docs-border-color-faint);\n}\n\n.markdown tbody td {\n  vertical-align: top;\n  padding: 0.5em;\n}\n\n.markdown tbody td:first-child {\n  padding-left: 0;\n}\n\n.markdown code {\n  color: var(--docs-code-color);\n  font-weight: 600;\n  font-size: 0.875em;\n}\n\n.markdown p {\n  margin: 1.25em 0;\n}\n\n.markdown ol,\n.markdown ul {\n  margin: 1.25em 0;\n  padding: 0;\n}\n\n.markdown ol {\n  margin-left: 1em;\n}\n\n.markdown ul {\n  list-style: none;\n}\n\n.markdown li {\n  margin: 0.5em 0;\n}\n\n.markdown ul > li {\n  position: relative;\n  padding-left: 1.75em;\n}\n\n.markdown ul > li::before {\n  content: \"\";\n  position: absolute;\n  background-color: currentColor;\n  border-radius: 50%;\n  width: 0.375em;\n  height: 0.375em;\n  top: calc(0.875em - 0.1875em);\n  left: 0.25em;\n}\n\n.markdown pre {\n  max-width: 100%;\n  color: black;\n  tab-size: 2;\n  overflow-x: auto;\n  font-size: 1em;\n  line-height: 1.7;\n  margin: 1.5em 0;\n  border-radius: 0.375rem;\n  padding: 0.85em 1.15em;\n}\n\n.markdown blockquote {\n  font-weight: 500;\n  font-style: italic;\n  border-left-width: 0.25rem;\n  border-left-color: #e5e7eb;\n  quotes: \"\\201C\"\"\\201D\"\"\\2018\"\"\\2019\";\n  margin-top: 1.6em;\n  margin-bottom: 1.6em;\n  padding-left: 1em;\n}\n\n/**\n * Utility CSS\n * --------------------------------------------------------\n */\n\n.appearance-none { -webkit-appearance: none; -moz-appearance: none; appearance: none; }\n\n.border { border-width: 1px; border-style: solid; }\n.border-none { border: none; }\n.border-top { border-top-width: 1px; border-top-style: solid; }\n.border-right { border-right-width: 1px; border-right-style: solid; }\n.border-left { border-left-width: 1px; border-left-style: solid; }\n.border-bottom { border-bottom-width: 1px; border-bottom-style: solid; }\n.border-left-3 { border-width: 3px; }\n\n.block { display: block; }\n.hidden { display: none; }\n.inline { display: inline; }\n.inline-block { display: inline-block; }\n.inline-flex { display: inline-flex; }\n.flex { display: flex; }\n\n.rounded { border-radius: var(--docs-spacing-1, 0.25rem); }\n.rounded-full { border-radius: 9999px; }\n\n.cursor-pointer { cursor: pointer; }\n\n.flex-row { flex-direction: row; }\n.flex-1 { flex: 1; }\n.flex-shrink { flex-shrink: 1; }\n.flex-wrap { flex-wrap: wrap; }\n.flex-nowrap { flex-wrap: nowrap; }\n.items-center { align-items: center; }\n.justify-center { justify-content: center; }\n\n.font-bold { font-weight: bold; }\n.font-normal { font-weight: normal; }\n.font-mono { font-family: monospace, monospace; font-size: 1em; }\n.font-semibold { font-weight: 600; }\n\n.h-12 { height: var(--docs-spacing-12); }\n.h-full { height: 100%; }\n.h-screen { height: 100vh; }\n\n.list-none { list-style: none; }\n\n.m-0 { margin: 0; }\n.mx-auto { margin-left: auto; margin-right: auto; }\n.my-2 { margin-top: var(--docs-spacing-2); margin-bottom: var(--docs-spacing-2); }\n.my-8 { margin-top: var(--docs-spacing-8); margin-bottom: var(--docs-spacing-8); }\n.ml-2 { margin-left: var(--docs-spacing-2); }\n.mt-2 { margin-top: var(--docs-spacing-2); }\n.mt-4 { margin-top: var(--docs-spacing-4); }\n.mt-6 { margin-top: var(--docs-spacing-6); }\n.mt-12 { margin-top: var(--docs-spacing-12); }\n.mr-2 { margin-right: var(--docs-spacing-2); }\n.mr-4 { margin-right: var(--docs-spacing-4); }\n.mb-2 { margin-bottom: var(--docs-spacing-2); }\n.mb-4 { margin-bottom: var(--docs-spacing-4); }\n.mb-8 { margin-bottom: var(--docs-spacing-8); }\n\n.opacity-0 { opacity: 0; }\n.opacity-50 { opacity: 0.5; }\n.overflow-hidden { overflow: hidden; }\n.overflow-x-hidden { overflow-x: hidden; }\n.overflow-y-auto { overflow-y: auto; }\n\n.p-6 { padding: var(--docs-spacing-6); }\n.px-1 { padding-left: var(--docs-spacing-1); padding-right: var(--docs-spacing-1); }\n.px-3 { padding-left: var(--docs-spacing-3); padding-right: var(--docs-spacing-3); }\n.px-4 { padding-left: var(--docs-spacing-4); padding-right: var(--docs-spacing-4); }\n.px-6 { padding-left: var(--docs-spacing-6); padding-right: var(--docs-spacing-6); }\n.py-1 { padding-top: var(--docs-spacing-1); padding-bottom: var(--docs-spacing-1); }\n.py-2 { padding-top: var(--docs-spacing-2); padding-bottom: var(--docs-spacing-2); }\n.py-3 { padding-top: var(--docs-spacing-3); padding-bottom: var(--docs-spacing-3); }\n.py-4 { padding-top: var(--docs-spacing-4); padding-bottom: var(--docs-spacing-4); }\n.pl-5 { padding-left: var(--docs-spacing-5); }\n.pt-1 { padding-top: var(--docs-spacing-1); }\n.pt-8 { padding-top: var(--docs-spacing-8); }\n.pt-12 { padding-top: var(--docs-spacing-12); }\n.pb-1 { padding-bottom: var(--docs-spacing-1); }\n\n.absolute { position: absolute; }\n.relative { position: relative; }\n.sticky { position: sticky; }\n.fixed { position: fixed; }\n\n.overflow-ellipsis { overflow: hidden; text-overflow: ellipsis; }\n\n.text-uppercase { text-transform: uppercase; }\n.text-sm { font-size: 0.875rem; line-height: 1.25; }\n.text-xl { font-size: 1.25rem; line-height: 1.25; }\n.text-2xl { font-size: 2rem; line-height: 1.25; }\n.text-3xl { font-size: 3rem; line-height: 1.25; }\n\n.w-auto { width: auto; }\n.w-40 { width: var(--docs-spacing-40); }\n.w-72 { width: var(--docs-spacing-72); }\n.w-full { width: 100%; }\n\n.whitespace-nowrap { white-space: nowrap; }\n\n.z-10 { z-index: 10; }\n.z-20 { z-index: 20; }\n\n.fill-current { fill: currentColor; }\n.inset-y-0 { top: 0px; bottom: 0px; }\n.no-underline { text-decoration: none; }\n.ring-opacity-50 { --docs-ring-opacity: 0.5; }\n\n/* Colors */\n\n.bg-theme { background-color: var(--docs-bg-color); }\n.border-color-faint { border-color: var(--docs-border-color-faint); }\n.border-theme-faint { border-color: var(--docs-theme-color-faint); }\n.text-color { color: var(--docs-text-color); }\n.text-color-faint { color: var(--docs-text-color-faint); }\n.text-white { --docs-text-opacity: 1; color: rgba(255, 255, 255, var(--docs-text-opacity)); }\n\n/* Interactions */\n\n.hover\\:opacity-100:hover { opacity: 1; }\n.hover\\:text-color-inherit:hover { color: inherit; }\n\n/**\n * Widescreen breakpoint\n* --------------------------------------------------------\n */\n\n@media (min-width: 1088px) {\n  .container { max-width: 1400px; }\n  .navigation { right: auto; }\n\n  .wide\\:block { display: block; }\n  .wide\\:flex { display: flex; }\n  .wide\\:hidden { display: none; }\n\n  .wide\\:flex-row { flex-direction: row; }\n\n  .wide\\:sticky { position: sticky; }\n  .wide\\:opacity-0 { opacity: 0; }\n  .wide\\:opacity-1 { opacity: 1; }\n\n  .wide\\:left-0 { left: 0; }\n  .wide\\:right-0 { right: 0; }\n  .wide\\:top-16 { top: var(--docs-spacing-16); }\n\n  .wide\\:px-20 {padding-left: var(--docs-spacing-20); padding-right: var(--docs-spacing-20);}\n  .wide\\:px-40 {padding-left: var(--docs-spacing-40); padding-right: var(--docs-spacing-40);}\n}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/includes/assets/inline.js",
    "content": "/**\n * Navigation display\n */\nfunction setupNavigationDrawer() {\n  const navigation = document.getElementById('navigation');\n  const closebtn = document.getElementById('close-nav');\n  const showbtn = document.getElementById('show-nav');\n  let navopen = false;\n\n  if (closebtn == null || showbtn == null || navigation == null) {\n    return;\n  }\n\n  // SHOW\n  function showNavigation() {\n    navigation.classList.remove('opacity-0');\n    navigation.style.right = 'auto';\n    showbtn.classList.add('hidden');\n    closebtn.classList.remove('hidden');\n    navopen = true;\n  }\n  showbtn.addEventListener('click', showNavigation);\n  // CLOSE\n  function closeNavigation() {\n    navigation.classList.add('opacity-0');\n    closebtn.classList.add('hidden');\n    navigation.style.right = null;\n    showbtn.classList.remove('hidden');\n    navopen = false;\n  }\n  document.addEventListener('click', (e) => {\n    if (\n      navopen &&\n      !navigation.contains(e.target) &&\n      !showbtn.contains(e.target)\n    ) {\n      closeNavigation();\n    }\n  });\n  document.addEventListener('keydown', (e) => {\n    if (navopen && e.key === 'Escape') {\n      closeNavigation();\n    }\n  });\n}\n\n/**\n * Preserve nav scroll position across page loads\n */\nfunction setupNavigationScroll() {\n  const scroller = document.getElementById('navigation-scroller');\n  const navScrollPositionKey = 'navScrollPosition';\n\n  if (scroller == null) {\n    return;\n  }\n\n  window.addEventListener('unload', function () {\n    const navScrollPosition = scroller.scrollTop;\n    localStorage.setItem(navScrollPositionKey, navScrollPosition);\n  });\n  const previousScrollPosition = localStorage.getItem(navScrollPositionKey);\n  if (previousScrollPosition != null) {\n    scroller.scrollTop = previousScrollPosition;\n  }\n}\n\ndocument.addEventListener('DOMContentLoaded', function () {\n  setupNavigationDrawer();\n  setupNavigationScroll();\n});\n"
  },
  {
    "path": "packages/react-native-web-docs/src/includes/fragments/footer.html",
    "content": "<div class=\"view flex-row items-center mt-12 py-4 border-top border-color-faint\">\n  {% if site.enableGithubLink == 1 %}\n  <a aria-label=\"Link to {{ site.name }} GitHub repository\" class=\"inline-block mr-2 opacity-50 hover:opacity-100 text-color\" style=\"width:20px;height:20px;vertical-align:middle;\" rel=\"noopener noreferrer\" href=\"{{ site.githubUrl}}\" target=\"_blank\">\n    {{ '/src/includes/assets/svg/github.svg' | svgContents(\"w-full\") | safe }}\n  </a>\n  {% endif %}\n\n  <div class=\"text text-sm text-color-faint\">\n    <a class=\"no-underline\" href=\"{{ \"/\" | url }}\">{{ site.name }}</a> –\n    {% if site.footer %}\n      <span>{{ site.footer | safe }}</span>\n    {% endif %}\n  </div>\n</div>\n"
  },
  {
    "path": "packages/react-native-web-docs/src/includes/fragments/macros.html",
    "content": "{% macro button(text, href) %}\n  <a href=\"{{ href }}\" class=\"view inline-flex flex-row items-center py-3 px-6 border rounded text-xl text-white font-bold\" style=\"background-color:var(--docs-theme-color); border-color:var(--docs-theme-color); color:white; text-decoration:none;\">\n    {{ text }}\n  </a>\n{% endmacro %}\n\n{% macro docbutton(text, href) %}\n  <a href=\"{{ href | url }}\" class=\"view inline-flex flex-row items-center py-3 px-6 border rounded text-xl text-white font-bold no-underline\" style=\"background-color:var(--docs-theme-color); border-color:var(--docs-theme-color); color:white; text-decoration:\">\n    <span class=\"view mr-2\" style=\"width:20px;\">\n      {{ '/src/includes/assets/svg/documents.svg' | svgContents(\"w-full fill-current\") | safe }}\n    </span>\n    <span>{{ text }}</span>\n  </a>\n{% endmacro %}\n\n{% macro codebutton(text, href) %}\n  <a href=\"{{ href }}\" class=\"view inline-flex flex-row items-center py-3 px-6 border rounded text-xl no-underline font-mono text-color\" style=\"border-color:currentColor;\">\n    <span aria-hidden=\"true\" class=\"mr-2\">$ </span>\n    <span class=\"inline-block whitespace-nowrap overflow-ellipsis\">{{ text }}</span>\n  </a>\n{% endmacro %}\n\n{% macro prop(name, type) %}\n  <div class=\"prop border-left border-left-3 border-theme-faint pl-5 overflow-ellipsis\">\n    <span class=\"font-bold\">{{ name }}</span>\n    {%- if type != null -%}<span aria-hidden=\"true\">:</span> <span class=\"whitespace-nowrap text-color-faint\">{{ type }}</span>{%- endif %}\n    {{ caller() }}\n  </div>\n{% endmacro %}\n\n{% macro codesandbox(path = '/') %}\n  <iframe\n  src=\"https://codesandbox.io/embed/github/necolas/react-native-web/tree/{{ site.packageVersion }}/packages/react-native-web-examples?codemirror=1&fontsize=12&hidedevtools=1&hidenavigation=1&initialpath=/{{ path }}&module=%2Fpages%2F{{ path }}%2Findex.js&theme=light\"\n  style=\"width:100%; height:500px; border:1px solid var(--docs-border-color); border-radius:4px; overflow:hidden;\"\n  title=\"React Native for Web: {{ path}} examples\"\n  sandbox=\"allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\"\n  ></iframe>\n{% endmacro %}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/includes/fragments/nav.html",
    "content": "{% set navPages = collections.nav | eleventyNavigation %}\n\n<nav id=\"navigation-scroller\" class=\"view overflow-x-hidden overflow-y-auto h-full p-6 pt-12\">\n  <h1 class=\"m-0 mb-4\" style=\"font-size:1rem;\">\n    <a class=\"view no-underline group font-semibold\" href=\"{{ '/' | url }}\" style=\"color:var(--docs-theme-color)\">\n      <span class=\"view flex-row items-center overflow-hidden mb-1 text-xl\">\n        {{ site.name }}\n      </span>\n      <span>{{ site.packageName }}@{{ site.packageVersion }}</span>\n    </a>\n  </h1>\n\n  {% macro renderNavListItem(entry) -%}\n    {% set itemClassName %}\n      {% if entry.url == page.url %}\n      font-semibold text-color-inherit\n      {% else %}\n      text-color-faint hover:text-color-inherit\n      {% endif %}\n    {% endset %}\n\n    {% set itemStyle %}\n      {% if entry.url == page.url %}\n      background-color:var(--docs-theme-color-faded); border-left:3px solid var(--docs-theme-color); margin-left:-13px; border-radius:0 0.25rem 0.25rem 0;\n      {% endif %}\n    {% endset %}\n\n    <li class=\"view item mb-2\">\n      {%- if entry.url != false -%}\n    <a class=\"text block {{ itemClassName }}\" href=\"{{ entry.url | url }}\" style=\"padding:2px 10px; margin:-2px -10px;{{itemStyle}}\">\n          {{ entry.title }}\n          {% if entry.label != null %}\n            {% set labelColor -%}\n              {%- if entry.label == 'Change' -%}\n                #ff8300\n              {%- else -%}\n                #86b300\n              {%- endif -%}\n            {%- endset %}\n          <span class=\"px-1 ml-2 inline-block border rounded text-uppercase text-sm\" style=\"border-color:{{labelColor}}; color:{{labelColor}}; font-weight:normal\">{{ entry.label }}</span>\n          {% endif %}\n        </a>\n      {% else %}\n        <span class=\"text block font-semibold text-uppercase text-sm\">{{ entry.title }}</span>\n      {% endif %}\n\n      {%- if entry.children.length -%}\n      <ul class=\"view list-none mt-2 mb-4\">\n        {%- for child in entry.children %}{{ renderNavListItem(child) }}{% endfor -%}\n      </ul>\n      {%- endif -%}\n    </li>\n  {%- endmacro %}\n\n  <ul class=\"view list-none mt-6\">\n    {%- for entry in navPages %}\n      {{ renderNavListItem(entry) }}\n    {%- endfor -%}\n  </ul>\n</nav>\n"
  },
  {
    "path": "packages/react-native-web-docs/src/includes/layouts/404.html",
    "content": "---\nlayout: layouts/shell.html\nsection: page\n---\n\n<article class=\"view items-center p-6 w-full\">\n  <h1 class=\"text-3xl\">{{ title }}</h1>\n  <div style=\"width:75%\">\n    {{ '/src/includes/assets/svg/404.svg' | svgContents(\"w-full\") | safe }}\n  </div>\n</article>\n"
  },
  {
    "path": "packages/react-native-web-docs/src/includes/layouts/home.html",
    "content": "---\nlayout: layouts/shell.html\nsection: page\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n<main id=\"main\" class=\"view flex-1\">\n  <div class=\"view w-full mt-12 px-6 wide:px-20\">\n    <div class=\"view w-full\">\n      <div class=\"view flex-1\">\n        <h1 class=\"view flex-row items-center font-bold\">\n          <span aria-hidden=\"true\" rclass=\"block mr-2\" style=\"width:50px;height:50px;margin-left:-6px;color:var(--docs-theme-color)\">\n            {{ '/src/includes/assets/svg/logo.svg' | svgContents(\"w-full\") | safe }}\n          </span>\n          <span class=\"text\" style=\"color:var(--docs-theme-color); font-size:1.75rem;\">{{ site.name }}</span>\n        </h1>\n        <h2 class=\"text my-8 text-3xl\">React Native Components and APIs on the Web</h2>\n        <p class=\"text mb-8 text-2xl\">{{ site.name }} is an accessible implementation of React Native's Components and APIs that is interoperable with React DOM.</p>\n      </div>\n    </div>\n    <div class=\"view flex-row flex-wrap\">\n      <div class=\"view my-2 mr-4\">\n        {{ macro.docbutton('Documentation', '/docs') }}\n      </div>\n      <div class=\"view flex-shrink my-2\">\n        {{ macro.codebutton('npm i react-native-web', site.packageUrl) }}\n      </div>\n    </div>\n\n    <div class=\"markdown mt-6\">\n      <ul style=\"font-size:1.25rem;\">\n        <li><strong>Accessible HTML</strong>. Support different devices and input modes, render semantic tags.</li>\n        <li><strong>High-quality interactions</strong>. Support gestures and multiple input modes (touch, mouse, keyboard).</li>\n        <li><strong>Reliable styles</strong>. Rely on scoped styles and automatic vendor-prefixing. Support RTL layouts.</li>\n        <li><strong>Responsive containers</strong>. Respond to element resize events.</li>\n        <li><strong>Incremental adoption</strong>. Interoperates with existing React DOM components. Bundle only what you use.</li>\n      </ul>\n\n      <h2>Try it out!</h2>\n\n      <p>You can try {{ site.name }} from your browser using the <a href=\"https://codesandbox.io/s/react-native-q4qymyp2l6\">official template on CodeSandbox</a>.</p>\n\n      <p>Fork the template and create your own app without leaving the browser.</p>\n\n      <iframe\n        src=\"https://codesandbox.io/embed/react-native-q4qymyp2l6?codemirror=1&fontsize=12&hidedevtools=1&hidenavigation=1&theme=light\"\n        style=\"width:100%; height:500px; border:1px solid var(--docs-border-color); border-radius: 4px; overflow:hidden;\"\n        title=\"React Native for Web preview\"\n        sandbox=\"allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\"\n      ></iframe>\n\n      <div class=\"callout\">\n        <p><strong>Did you know?</strong> React Native for Web powers web support in multi-platform React tools like <a href=\"https://expo.dev\">Expo</a>, <a href=\"https://reactnativeelements.com/\">React Native Elements</a>, <a href=\"https://callstack.github.io/react-native-paper/using-on-the-web.html\">React Native Paper</a>, and <a href=\"https://docs.nativebase.io/getting-started\">NativeBase</a>.\n      </div>\n\n      <div style=\"height:2rem\"><!-- spacer --></div>\n    </div>\n    {% include \"fragments/footer.html\" %}\n  </div>\n</main>\n"
  },
  {
    "path": "packages/react-native-web-docs/src/includes/layouts/page.html",
    "content": "---\nlayout: layouts/shell.html\nsection: page\n---\n\n<div class=\"view fixed wide:hidden z-20\" style=\"right:30px; bottom:30px;\">\n  <button id=\"show-nav\" aria-label=\"Show navigation\" class=\"view appearance-none rounded-full items-center justify-center text-white cursor-pointer\" style=\"background-color:var(--docs-theme-color); width:4rem; height:4rem; padding:5px;\">\n    {{ '/src/includes/assets/svg/logo.svg' | svgContents(\"w-full fill-current\") | safe }}\n  </button>\n  <button id=\"close-nav\" aria-label=\"Close navigation\" class=\"view appearance-none hidden rounded-full items-center justify-center text-white cursor-pointer\" style=\"background-color:var(--docs-theme-color); width:4rem; height:4rem; padding:10px;\">\n    {{ '/src/includes/assets/svg/close.svg' | svgContents(\"w-full\") | safe }}\n  </button>\n</div>\n\n<div class=\"view flex-row flex-nowrap relative\">\n  <div id=\"navigation\" class=\"navigation view fixed wide:sticky wide:left-0 z-10 opacity-0 wide:opacity-1 h-screen inset-y-0 w-72 border-right border-color-faint bg-theme\">\n    {% include \"fragments/nav.html\" %}\n  </div>\n\n  <main id=\"main\" class=\"view flex-1\">\n    <div class=\"view w-full mt-12 px-4 wide:px-20\">\n      <article class=\"markdown\">\n        <h1>{{ title }}</h1>\n        {{ layoutContent | safe }}\n      </article>\n\n      <div class=\"flex mt-4\">\n        <div class=\"inline-block w-auto text-sm pt-1 pb-1 mr-2 rounded text-color-faint\">Updated <time datetime=\"{{ page.date | machineDate }}\">{{ page.date | readableDate }}</time></div>\n        {% if site.enableEditButton == true %}\n          <a class=\"no-underline inline-block w-auto text-sm hover:bg-gray-200 py-1 px-3 rounded text-color-faint\" href=\"{{ site.githubUrl }}/edit/{{ site.githubBranch }}/packages/docs/{{ page.inputPath }}\" target=\"_blank\">Edit</a>\n        {% endif %}\n        </div>\n        {% include \"fragments/footer.html\" %} \n      </div>\n    </div>\n  </main>\n</div>\n"
  },
  {
    "path": "packages/react-native-web-docs/src/includes/layouts/shell.html",
    "content": "<!doctype html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    {%- set htmltitle -%}\n      {%- if page.fileSlug === 'home' -%}\n      {{- renderData.title or title -}}\n      {%- else -%}\n      {{- renderData.title or title }} // {{ site.name -}}\n      {%- endif -%}\n    {%- endset -%}\n    <title>{{ htmltitle }}</title>\n    <meta property=\"og:title\" content=\"{{ htmltitle }}\"/>\n    <meta name=\"description\" content=\"{{ metaDescription or renderData.metaDescription or site.description }}\">\n    <link rel=\"icon\" href=\"{{ '/static/logo.svg' | url }}\">\n    {% set cssinline %}\n      {% include \"assets/inline.css\" %}\n    {% endset %}\n    <style>{{ cssinline | cssmin | safe }}</style>\n    <link rel=\"stylesheet\" media=\"(prefers-color-scheme:light)\" href=\"https://unpkg.com/prismjs@1.20.0/themes/prism.css\">\n    <link rel=\"stylesheet\" media=\"(prefers-color-scheme:dark)\" href=\"https://unpkg.com/prismjs@1.20.0/themes/prism-okaidia.css\">\n    {% set jsinline %}\n      {% include \"assets/inline.js\" %}\n    {% endset %}\n    <script defer>{{ jsinline | jsmin | safe }}</script>\n  </head>\n<body>\n\n<div id=\"app\" class=\"container mx-auto\">\n  <div class=\"view\">\n    {{ layoutContent | safe }}\n  </div>\n</div>\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/404.md",
    "content": "---\ntitle: 404\npermalink: /404.html\nlayout: layouts/404.html\n---\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/apis/_.md",
    "content": "---\ntitle: APIs\ndate: Last Modified\npermalink: false\neleventyNavigation:\n  key: APIs\n  title: APIs\n  order: 30 \n---\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/apis/animated.md",
    "content": "---\ntitle: Animated\ndate: Last Modified\npermalink: /docs/animated/index.html\neleventyNavigation:\n  key: Animated\n  parent: APIs\n---\n\n:::lead\nAnimated focuses on declarative relationships between inputs and outputs, configurable transforms in between, and start/stop methods to control time-based animation execution.\n:::\n\nThis API is the same JavaScript implementation as found in React Native. Please refer to the React Native documentation below:\n\n* [Animated](https://reactnative.dev/docs/animated)\n\n:::callout\n**Warning!** The React Native animation API is not optimized for the web. You may prefer to use external modules that are designed for multi-platform animations and provide better performance, e.g., [React Spring](https://www.react-spring.io/).\n:::\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/apis/app-registry.md",
    "content": "---\ntitle: AppRegistry\ndate: Last Modified\npermalink: /docs/app-registry/index.html\neleventyNavigation:\n  key: AppRegistry\n  parent: APIs\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nAppRegistry is the control point for registering, running, prerendering, and unmounting all apps.\n:::\n\nApp root components should register themselves with `AppRegistry.`registerComponent. Apps can be run by invoking `AppRegistry.runApplication`.\n\n```js\nimport { AppRegistry } from 'react-native';\n```\n\n---\n\n## API\n\n### Static methods\n\n{% call macro.prop('getAppKeys', '() => Array<string>') %}\nReturns an array of all registered app keys\n{% endcall %}\n\n{% call macro.prop('getApplication', '(key: string, params: AppParams) => ({ element, getStyleElement })') %}\nA web-only method for server-side rendering to HTML and CSS. It returns an object containing the given application's `element` and `getStyleElement` function to get styles once the element is rendered.\n{% endcall %}\n\n{% call macro.prop('registerComponent', '(key: string, getComponent: () => React.Element) => void') %}\nRegister a component provider under the given `key`.\n{% endcall %}\n\n{% call macro.prop('registerConfig', '(configs: Array<AppConfig>) => void') %}\nRegister multiple applications.\n{% endcall %}\n\n{% call macro.prop('unmountApplicationComponentAtRootTag', 'rootTag: HTMLElement') %}\nCalled this function with the `rootTag` that was passed into `runApplication` in order to unmount it.\n{% endcall %}\n\n### AppConfig\n\n{% call macro.prop('appKey', 'string') %}\nThe `key` under which the component is registered.\n{% endcall %}\n\n{% call macro.prop('component', '() => React.Element') %}\nA function that returns a React element.\n{% endcall %}\n\n### AppParams\n\n{% call macro.prop('callback', '?() => void') %}\nCalled when React rendering has finished.\n{% endcall %}\n\n{% call macro.prop('hydrate', '?boolean') %}\nIf the client should hydrate server-rendered HTML.\n{% endcall %}\n\n{% call macro.prop('initialProps', '?Object') %}\nThe initial props passed to the root component.\n{% endcall %}\n\n{% call macro.prop('rootTag', 'HTMLElement') %}\nThe native element into which the application is rendered.\n{% endcall %}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/apis/app-state.md",
    "content": "---\ntitle: AppState\ndate: Last Modified\npermalink: /docs/app-state/index.html\neleventyNavigation:\n  key: AppState\n  parent: APIs\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nAppState can tell you if the app is in the foreground or background, and notify you when the state changes.\n:::\n\nStates: active (the app is running in the foreground), background (the app is running in the background, i.e., the user has not focused the app's tab).\n\n\n```js\nimport { AppState } from 'react-native';\n```\n\n---\n\n## API\n\n### Static properties\n\n{% call macro.prop('isAvailable', 'boolean') %}\nWhether the browser environment supports `AppState`.\n{% endcall %}\n\n{% call macro.prop('currentState', '?(\"active\" | \"background\")') %}\nReturns the current state of the app.\n{% endcall %}\n\n### Static methods\n\n{% call macro.prop('addEventListener', '(type: ?string, listener: (boolean) => void) => ?EmitterSubscription') %}\nAdd a listener to `AppState` changes. Listen to the `\"change\"` event type. The handler is called with the app state value.\n{% endcall %}\n\n---\n\n## Examples\n\n{{ macro.codesandbox('app-state') }}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/apis/appearance.md",
    "content": "---\ntitle: Appearance\ndate: Last Modified\npermalink: /docs/appearance/index.html\neleventyNavigation:\n  key: Appearance\n  parent: APIs\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nThe Appearance module exposes information about the user's appearance preferences, such as their preferred color scheme (light or dark).\n:::\n\n```js\nimport { Appearance } from 'react-native';\n```\n\n---\n\n## API\n\n### Static methods\n\n{% call macro.prop('addChangeListener', '(listener) => { remove: () => void }') %}\nAdd an event handler that is called with `{colorScheme: \"dark\" | \"light\"}` when appearance preferences change. Returns a `remove` method used to remove the change listener.\n{% endcall %}\n\n{% call macro.prop('getColorScheme', '() => (\"dark\" | \"light\")') %}\nYou can use the Appearance module to determine if the user prefers a dark color scheme. Although the color scheme is available immediately, this may change (e.g. scheduled color scheme change at sunrise or sunset). Any rendering logic or styles that depend on the user preferred color scheme should try to call this function on every render, rather than caching the value.\n{% endcall %}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/apis/clipboard.md",
    "content": "---\ntitle: Clipboard\ndate: Last Modified\npermalink: /docs/clipboard/index.html\neleventyNavigation:\n  key: Clipboard\n  parent: APIs\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nClipboard gives you an interface for setting to the clipboard. (Getting clipboard content is not currently supported on web.)\n:::\n\n```js\nimport { Clipboard } from 'react-native';\n```\n\n---\n\n## API\n\n### Static methods\n\n{% call macro.prop('isAvailable', '() => boolean') %}\nDetermines whether the browser environment supports Clipboard at all.\n{% endcall %}\n\n{% call macro.prop('setString', '() => boolean') %}\nCopies a string to the clipboard. On web, some browsers may not support copying to the clipboard, therefore, this function returns a boolean to indicate if the copy was successful.\n{% endcall %}\n\n{% call macro.prop('getString', '() => Promise<\"\">') %}\nNot properly supported on Web. Returns a Promise of an empty string.\n{% endcall %}\n\n---\n\n## Examples\n\n{{ macro.codesandbox('clipboard') }}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/apis/dimensions.md",
    "content": "---\ntitle: Dimensions\ndate: Last Modified\npermalink: /docs/dimensions/index.html\neleventyNavigation:\n  key: Dimensions\n  parent: APIs\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nRespond to changes in the viewport dimensions.\n:::\n\nDimensions may change (e.g., due to device rotation) so any rendering logic or styles that depend on these constants should try to call this function on every render, rather than caching the value.\n\n```js\nimport { Dimensions } from 'react-native';\n```\n\n---\n\n## API\n\n### Static methods\n\n{% call macro.prop('get', '(string: \"window\" | \"screen\") => Dimension') %}\nGet a dimension (e.g., window or screen).\n{% endcall %}\n\n{% call macro.prop('set', '(dimensions: { window: Dimension, screen: Dimension }) => void') %}\nThis should only be called server-side with an estimate for initial dimensions to be used when pre-rendering pages on the server.\n{% endcall %}\n\n{% call macro.prop('addEventListener', '(type: ?string, listener: (dimensions) => void) => ?EmitterSubscription') %}\nAdd a listener to `Dimensions` changes. Listen to the `\"change\"` event type. The handler is called with the dimensions state.\n{% endcall %}\n\n{% call macro.prop('removeEventListener', '(type: ?string, listener: (dimensions) => void) => void') %}\nRemove a listener from `Dimensions` changes.\n{% endcall %}\n\n### Dimension\n\n{% call macro.prop('height', 'number') %}\nThe height of the dimension.\n{% endcall %}\n\n{% call macro.prop('width', 'number') %}\nThe width of the dimension.\n{% endcall %}\n\n---\n\n## Examples\n\n{{ macro.codesandbox('dimensions') }}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/apis/linking.md",
    "content": "---\ntitle: Linking\ndate: Last Modified\npermalink: /docs/linking/index.html\neleventyNavigation:\n  key: Linking\n  parent: APIs\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nLinking gives you a general interface for securely opening external URLs from JavaScript.\n:::\n\n```js\nimport { Linking } from 'react-native';\n```\n\n---\n\n## API\n\n### Static methods\n\n{% call macro.prop('canOpenURL', '(url) => Promise<boolean>') %}\nReturns a `Promise` that resolves to a boolean indicating whether the app can open the URL.\n{% endcall %}\n\n{% call macro.prop('getInitialURL', '() => Promise<string>') %}\nReturns a `Promise` that resolves to the string of the URL that initially loaded the app.\n{% endcall %}\n\n{% call macro.prop('openURL', '(url, target) => Promise<>') %}\nTry to open the given url in a secure fashion. The provided target (including `undefined`) will be passed as the window target, or \"_blank\" if no target included. The method returns a Promise object. If the url opens, the promise is resolved. If not, the promise is rejected.\n{% endcall %}\n\n---\n\n## Examples\n\n{{ macro.codesandbox('linking') }}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/apis/pan-responder.md",
    "content": "---\ntitle: PanResponder\ndate: Last Modified\npermalink: /docs/pan-responder/index.html\neleventyNavigation:\n  key: PanResponder\n  parent: APIs\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nPanResponder reconciles several pointers into a single gesture. It makes single-pointer gestures resilient to extra touches, and can be used to recognize basic multi-touch gestures.\n:::\n\n:::callout\n**Note:** Using the `PanResponder` on components that contain text may cause native text selection events to interrupt the pan gesture. This can be avoided by setting `userSelect: 'none'` on the text elements while the gesture is active.\n:::\n\nPlease refer to the React Native documentation below:\n\n* [PanResponder](https://reactnative.dev/docs/panresponder)\n\n---\n\n## Examples\n\n{{ macro.codesandbox('pan-responder') }}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/apis/pixel-ratio.md",
    "content": "---\ntitle: PixelRatio\ndate: Last Modified\npermalink: /docs/pixel-ratio/index.html\neleventyNavigation:\n  key: PixelRatio\n  parent: APIs\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\n`PixelRatio` class gives access to the device pixel density.\n:::\n\n```js\nimport { PixelRatio } from 'react-native';\n```\n\n---\n\n## API\n\n### Static methods\n\n{% call macro.prop('get', '() => number') %}\nReturns the device pixel density as a number.\n{% endcall %}\n\n{% call macro.prop('getFontScale', '() => number') %}\nOn web this returns the device pixel ratio as a number.\n{% endcall %}\n\n{% call macro.prop('getPixelSizeForLayoutSize', '(number) => number') %}\nConverts a layout size (dp) to pixel size (px). Guaranteed to return an integer number.\n{% endcall %}\n\n{% call macro.prop('roundToNearestPixel', '(number) => number') %}\nRounds a layout size (dp) to the nearest layout size that corresponds to an integer number of pixels. For example, on a device with a PixelRatio of 3, `PixelRatio.roundToNearestPixel(8.4) = 8.33`, which corresponds to exactly (8.33 * 3) = 25 pixels.\n{% endcall %}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/apis/platform.md",
    "content": "---\ntitle: Platform\ndate: Last Modified\npermalink: /docs/platform/index.html\neleventyNavigation:\n  key: Platform\n  parent: APIs\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nDetect what is the platform in which the app is running.\n:::\n\nThis piece of functionality can be useful when only small parts of a component are platform specific.\n\n```js\nimport { Platform } from 'react-native';\n```\n\n---\n\n## API\n\n### Static properties\n\n{% call macro.prop('OS', '\"web\"') %}\nThis value will be `\"web\"` when running in a Web browser.\n{% endcall %}\n\n### Static methods\n\n{% call macro.prop('select', '(config) => any') %}\nTakes an object containing `Platform.OS` values as keys and returns the value for the platform you are currently running on.\n{% endcall %}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/apis/style-sheet.md",
    "content": "---\ntitle: StyleSheet\ndate: Last Modified\npermalink: /docs/style-sheet/index.html\neleventyNavigation:\n  key: StyleSheet\n  parent: APIs\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nWork with strict styles that provide deterministic rendering and automatically adapt to localized writing direction.\n:::\n\nThe StyleSheet abstraction converts predefined styles to (vendor-prefixed) CSS without requiring a compile-time step. Styles that cannot be resolved outside of the render loop (e.g., dynamic positioning) are usually applied as inline styles.\n\n```js\nimport { StyleSheet } from 'react-native';\n```\n\n::: callout\n**Did you know?** StyleSheet automatically merges styles and produces \"utility\" CSS for lightweight, reliable, and performant styling. Read more in the [styling]({{ '/docs/styling' | url }}) guide.\n:::\n\n---\n\n## API\n\n### Static properties\n\n{% call macro.prop('absoluteFill', '?number') %}\nA very common pattern is to create overlays with position absolute and zero positioning, so `absoluteFill` can be used for convenience and to reduce duplication of these repeated styles.\n{% endcall %}\n\n{% call macro.prop('absoluteFillObject', '?Object') %}\nSometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be used to create a customized entry in a StyleSheet.\n{% endcall %}\n\n{% call macro.prop('hairlineWidth', '?Object') %}\nEqual to 1px. This is not implemented using screen density as browsers may round sub-pixel values down to `0`, causing the line not to be rendered.\n{% endcall %}\n\n### Static methods\n\n{% call macro.prop('create', '({ [key]: ruleset }) => ({ [key]: ruleset })') %}\nDefine style objects. Each key of the object passed to `create` must define a style object. These values should not be introspected at runtime.\n{% endcall %}\n\n{% call macro.prop('flatten', '(styles: Style) => Object') %}\nFlatten an array of styles into a single style object. **This is not recommended as it is not compatible with static extraction of styles to CSS.**\n{% endcall %}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/apis/vibration.md",
    "content": "---\ntitle: Vibration\ndate: Last Modified\npermalink: /docs/vibration/index.html\neleventyNavigation:\n  key: Vibration\n  parent: APIs\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nVibration is described as a pattern of on-off pulses, which may be of varying lengths. \n:::\n\nThe vibration pattern may consist of either a single integer, describing the number of milliseconds to vibrate, or an array of integers describing a pattern of vibrations and pauses. Vibration is controlled with a single method: `Vibration.vibrate()`.\n\n```js\nimport { Vibration } from 'react-native';\n```\n\n---\n\n## API\n\n### Static methods\n\n{% call macro.prop('cancel', '() => void') %}\nStop the vibration\n{% endcall %}\n\n{% call macro.prop('vibrate', '(number | Array<number>) => void') %}\nStart the vibration pattern\n{% endcall %}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/appendix/_.md",
    "content": "---\ntitle: Appendix\ndate: Last Modified\npermalink: false\neleventyNavigation:\n  key: Appendix\n  title: Appendix\n  order: 90\n---\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/appendix/about-project.md",
    "content": "---\ntitle: About the project\ndate: Last Modified\npermalink: /docs/about-project/index.html\ndescription:\neleventyNavigation:\n  key: About the project\n  parent: Appendix\n  order: 2\n---\n\n:::lead\n{{ site.name }}'s origins, evolution, and development.\n:::\n\n{{ site.name }} was started in 2015 by [Nicolas Gallagher](http://nicolasgallagher.com) during the development of [Twitter's Progressive Web App](https://blog.twitter.com/engineering/en_us/topics/open-source/2017/how-we-built-twitter-lite.html). It has evolved from a framework inspired by React Native into a mature and pragmatic compatibility layer between React DOM and React Native.\n\n{{ site.name }} is currently used in production Web apps by companies including [Meta](https://www.meta.com/), [Twitter](https://twitter.com), and [Flipkart](https://twitter.com/naqvitalha/status/969577892991549440). Software engineers from Meta, Expo, and elsewhere continue to contribute design and patches to the project.\n\nDeveloping a Web compatibility layer for React Native involves balancing the needs of high-quality Web apps with the value of React Native API compatibility. There are instances where parts of the React Native API are co-opted to infer information that is necessary or beneficial to products running in Web browsers. Other times there are use cases that are not accomodated by the APIs provided; even when that information cannot be pragmatically incorporated into the existing React Native API design constraints, it still helps to inform which API changes are needed over the long term.\n\nThe evolution of React Native now involves developers who work on React Native for Android, iOS, Web, Windows, and macOS. We aim to help designers and developers with shared, platform-agnostic React APIs that reduce time to market for high-quality, multi-platform products.\n\nPlease browse the [source code]({{ site.githubUrl }}) and consider contributing your experience to the project.\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/appendix/unstable-apis.md",
    "content": "---\ntitle: Unstable APIs\ndate: Last Modified\npermalink: /docs/unstable-apis/index.html\ndescription:\neleventyNavigation:\n  key: Unstable APIs\n  parent: Appendix\n  order: 1\n---\n\n:::lead\nThe following APIs are unstable and subject to breaking changes. Use at your own risk.\n:::\n\n## Use with existing React DOM components\n\nReact Native for Web exports a web-specific module called `unstable_createElement`, which can be used to wrap React DOM components. This allows you to use React Native's accessibility and style optimizations. Since this is a web-specific export it should always be imported from the `react-native-web` package.\n\nIn the example below, `Video` will now accept common React Native props such as `accessibilityLabel`, `accessible`, `style`, and even the Responder event props.\n\n```js\nimport { unstable_createElement } from 'react-native-web';\nconst Video = (props) => unstable_createElement('video', props);\n```\n\nThis also works with composite components defined in your existing component gallery or dependencies ([live example](https://www.webpackbin.com/bins/-KiTSGFw3fB9Szg7quLI)).\n\n```js\nimport RaisedButton from 'material-ui/RaisedButton';\nimport { unstable_createElement, useLocaleContext } from 'react-native-web';\nimport { StyleSheet, } from 'react-native';\n\nconst CustomButton = (props) => {\n  const { direction } = useLocaleContext();\n  return unstable_createElement(RaisedButton, {\n    ...props,\n    style: [ styles.button, props.style ]\n  });\n}, { writingDirection: direction });\n\nconst styles = StyleSheet.create({\n  button: {\n    padding: 20\n  }\n});\n```\n\nRemember that React Native styles are not the same as React DOM styles, and care needs to be taken not to pass React DOM styles into your React Native wrapped components.\n\n## Use as a library framework\n\nThe React Native (for Web) building blocks can be used to create higher-level components and abstractions. In the example below, a `styled` function provides an API inspired by styled-components ([live example](https://www.webpackbin.com/bins/-KjT9ziwv4O7FDZdvsnX)).\n\n```jsx\nimport { unstable_createElement } from 'react-native-web';\nimport { StyleSheet } from 'react-native';\n\n/**\n * styled API\n */\nconst styled = (Component, styler) => {\n  const isDOMComponent = typeof Component === 'string';\n\n  class Styled extends React.Component {\n    static contextTypes = {\n      getTheme: React.PropTypes.func\n    };\n\n    render() {\n      const theme = this.context.getTheme && this.context.getTheme();\n      const localProps = { ...this.props, theme };\n      const nextProps = { ...this.props }\n      const style = typeof styler === 'function' ? styler(localProps) : styler;\n      nextProps.style = [ style, this.props.style ];\n\n      return (\n        isDOMComponent\n          ? unstable_createElement(Component, nextProps)\n          : <Component {...nextProps} />\n      );\n    }\n  }\n  return Styled;\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    alignItems: 'center',\n    backgroundColor: '#2196F3',\n    flex: 1,\n    justifyContent: 'center'\n  }\n});\n\nconst StyledView = styled(View, styles.container);\n```\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/components/_.md",
    "content": "---\ntitle: Components\ndate: Last Modified\npermalink: false\neleventyNavigation:\n  key: Components\n  title: Components\n  order: 20 \n---\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/components/activity-indicator.md",
    "content": "---\ntitle: ActivityIndicator\ndate: Last Modified\npermalink: /docs/activity-indicator/index.html\neleventyNavigation:\n  key: ActivityIndicator\n  parent: Components\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nDisplays a customizable activity indicator.\n:::\n\n```jsx\nimport { ActivityIndicator } from 'react-native';\n\n<ActivityIndicator {...props} />;\n```\n\n---\n\n## API\n\n### Props\n\n{% call macro.prop('...ViewProps', '?ViewProps') %}\nAll the props supported by [View]({{ '/docs/view' | url }}).\n{% endcall %}\n\n{% call macro.prop('animating', '?boolean') %}\nDefault `true`. Set whether the activity indicator is animating.\n{% endcall %}\n\n{% call macro.prop('color', '?string') %}\nDefault `\"#1976D2\"`. Set the color of the activity indicator.\n{% endcall %}\n\n{% call macro.prop('hidesWhenStopped', '?boolean') %}\nDefault `true`. Set whether the activity indicator is hidden when not animating.\n{% endcall %}\n\n{% call macro.prop('size', '?(\"small\" | \"large\" | number)') %}\nDefault `\"small\"`. Set the size of the activity indicator.\n{% endcall %}\n\n---\n\n## Examples\n\n{{ macro.codesandbox('activity-indicator') }}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/components/checkbox.md",
    "content": "---\ntitle: CheckBox\ndate: Last Modified\npermalink: /docs/checkbox/index.html\neleventyNavigation:\n  key: CheckBox\n  parent: Components\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nAn accessible checkbox component with customizable appearance.\n:::\n\n`CheckBox` is a controlled component. The `onValueChange` callback should be used to update the `value` prop to reflect user actions. If the `value` prop is not updated, the component will continue to render the supplied `value` prop instead of the expected result of any user actions.\n\n```jsx\nimport { CheckBox } from 'react-native-web';\n\n<CheckBox {...props} />;\n```\n\n---\n\n## API\n\n### Props\n\n{% call macro.prop('...ViewProps', '?ViewProps') %}\nAll the props supported by [View]({{ '/docs/view' | url }}).\n{% endcall %}\n\n{% call macro.prop('color', '?string = \"#AAB8C2\"') %}\nSet the background color of the checkbox.\n{% endcall %}\n\n{% call macro.prop('disabled', '?boolean') %}\nPrevent all interactions with the checkbox.\n{% endcall %}\n\n{% call macro.prop('onChange', '?(e: ChangeEvent) => void') %}\nCalled when the state of the native checkbox changes.\n{% endcall %}\n\n{% call macro.prop('onValueChange', '?(value: boolean | \"mixed\") => void') %}\nCalled when the state of the native checkbox changes.\n{% endcall %}\n\n{% call macro.prop('value', '?(boolean | \"mixed\") = false') %}\nSet the value of the checkbox.\n{% endcall %}\n\n---\n\n## Examples\n\nNote that the size of the checkbox can be controlled by changing the `height` and `width` style properties.\n\n{{ macro.codesandbox('checkbox') }}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/components/image-background.md",
    "content": "---\ntitle: ImageBackground\ndate: Last Modified\npermalink: /docs/image-background/index.html\neleventyNavigation:\n  key: ImageBackground\n  parent: Components\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nAn image component with support for child content.\n:::\n\n```jsx\nimport { ImageBackground } from 'react-native';\n\n<ImageBackground {...props}>{children}</ImageBackground>;\n```\n\n---\n\n## API\n\n### Props\n\n{% call macro.prop('...ImageProps', '?ImageProps') %}\nAll the props supported by [Image]({{ '/docs/image' | url }}).\n{% endcall %}\n\n{% call macro.prop('children', '?any') %}\nContent to display over the image.\n{% endcall %}\n\n{% call macro.prop('imageStyle', '?Style') %}\nStyles to forward to the image component.\n{% endcall %}\n\n## Examples\n\n{{ macro.codesandbox('image-background') }}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/components/image.md",
    "content": "---\ntitle: Image\ndate: Last Modified\npermalink: /docs/image/index.html\neleventyNavigation:\n  key: Image\n  parent: Components\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nAn accessible and responsive image component.\n:::\n\nThis component renders images with flexbox layout and `cover` object-fit (rather than `stretch`) by default.\n\n```jsx\nimport { Image } from 'react-native';\n\n<Image {...props} />;\n```\n\n---\n\n## API\n\n### Props\n\n{% call macro.prop('...ViewProps', '?ViewProps') %}\nAll the props supported by [View]({{ '/docs/view' | url }}).\n{% endcall %}\n\n{% call macro.prop('blurRadius', '?number') %}\nThe radius of the blur filter added to the image\n{% endcall %}\n\n{% call macro.prop('defaultSource', '?Source') %}\nA static image to display while loading the image source.\n{% endcall %}\n\n{% call macro.prop('draggable', '?boolean = false') %}\nSet whether the image can be dragged with native browser behavior. (Web-only)\n{% endcall %}\n\n{% call macro.prop('onError', '?({ nativeEvent: { error } }) => void') %}\nCalled when the image fails to load.\n{% endcall %}\n\n{% call macro.prop('onLoad', '?({ nativeEvent: LoadEvent ) => void') %}\nCalled when the image successfully loads.\n{% endcall %}\n\n{% call macro.prop('onLoadEnd', '?() => void') %}\nCalled when image loading ends.\n{% endcall %}\n\n{% call macro.prop('onLoadStart', '?() => void') %}\nCalled when the image loading starts.\n{% endcall %}\n\n{% call macro.prop('resizeMode', '?(\"center\" | \"cover\" | \"contain\" | \"none\" | \"stretch\") = \"cover\"') %}\nDetermines how the image source is resized to fit the layout of the image element.\n{% endcall %}\n\n{% call macro.prop('source', '?(string | Source)') %}\nThe image source. The string can be a path to an external resource or a base64 encoded resource.\n{% endcall %}\n\n#### Source\n\n{% call macro.prop('height', '?number') %}\nSet the styles of the view.\n{% endcall %}\n\n{% call macro.prop('uri', '?string') %}\nSet the styles of the view.\n{% endcall %}\n\n{% call macro.prop('width', '?number') %}\nSet the styles of the view.\n{% endcall %}\n\n### Statics\n\n{% call macro.prop('getSize', '?(url: string, complete, failure) => void') %}\nDownload an image and measure the width and height (in pixels) prior to displaying it. This method can fail if the image cannot be found, or fails to download.\nComplete callback: `(width: number, height: number) => void`.\nFailure callback: `() => void`.\n{% endcall %}\n\n{% call macro.prop('prefetch', '?(url: string) => Promise') %}\nPrefetches a remote image for later use by downloading it. Once an image has been prefetched it is assumed to be in native browser caches and available for immediate rendering.\n{% endcall %}\n\n{% call macro.prop('queryCache', '?(urls: Array<string>) => Promise') %}\nPerforms cache interrogation. Returns a mapping from URL to cache status: \"disk\", \"memory\", \"disk/memory\". If a requested URL is not in the mapping, it means it's not in the cache.\n{% endcall %}\n\n---\n\n## Examples\n\n{{ macro.codesandbox('image') }}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/components/lists.md",
    "content": "---\ntitle: Lists\ndate: Last Modified\npermalink: /docs/lists/index.html\neleventyNavigation:\n  key: Lists\n  parent: Components\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nBasic support for FlatList, SectionList, and VirtualizedList.\n:::\n\nThese components are the same JavaScript implementations as those found in React Native. Please refer to the React Native documentation below:\n\n* [FlatList](https://reactnative.dev/docs/flatlist)\n* [SectionList](https://reactnative.dev/docs/sectionlist)\n* [VirtualizedList](https://reactnative.dev/docs/virtualizedlist)\n\n:::callout\n**Warning!** The React Native list components are not optimized for the web. You may prefer to use external modules that are designed for multi-platform lists and provide better performance, e.g., [RecyclerListView](https://github.com/Flipkart/recyclerlistview).\n:::\n\n---\n\n## Examples\n\n{{ macro.codesandbox('lists') }}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/components/modal.md",
    "content": "---\ntitle: Modal\ndate: Last Modified\npermalink: /docs/modal/index.html\neleventyNavigation:\n  key: Modal\n  parent: Components\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nA basic way to present content above an enclosing view. Modals may be nested within other Modals.\n:::\n\n```jsx\nimport { Modal } from 'react-native';\n\n<Modal {...props}>{children}</Modal>;\n```\n\n---\n\n## API\n\n### Props\n\n{% call macro.prop('animationType', '?(\"fade\" | \"none\" | \"slide\")') %}\nDefault is `\"none\"`. This can be used to add an animation to the modal being opened or closed.\n{% endcall %}\n\n{% call macro.prop('children', '?any') %}\nThe children of a `Modal` element will be hidden or shown depending on the modal visibility.\n{% endcall %}\n\n{% call macro.prop('onDismiss', '?() => void') %}\nCalled after the modal has been dismissed and is no longer visible.\n{% endcall %}\n\n{% call macro.prop('onRequestClose', '?() => void') %}\nCalled when the user is attempting to close the modal like when they hit `Escape`. Only the top-most Modal responds to hitting `Escape`.\n{% endcall %}\n\n{% call macro.prop('onShow', '?() => void') %}\nCalled after the modal has been shown and may be visible.\n{% endcall %}\n\n{% call macro.prop('transparent', '?boolean = false') %}\nDetermines if the modal is rendered with a transparent backdrop or a white backdrop\n{% endcall %}\n\n{% call macro.prop('visible', '?boolean = true') %}\nDetermines if the modal and its content is rendered.\n{% endcall %}\n\n---\n\n## Examples\n\n{{ macro.codesandbox('modal') }}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/components/picker.md",
    "content": "---\ntitle: Picker\ndate: Last Modified\npermalink: /docs/picker/index.html\neleventyNavigation:\n  key: Picker\n  parent: Components\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nRenders the native `<select>` component\n:::\n\n```jsx\nimport { Picker } from 'react-native';\n\n<Picker {...props}>\n  <Picker.Item />\n</Picker>;\n```\n\n---\n\n## API\n\n### Props\n\n{% call macro.prop('...ViewProps', '?ViewProps') %}\nAll the props supported by [View]({{ '/docs/view' | url }}).\n{% endcall %}\n\n{% call macro.prop('children', '?(...Picker.Item)') %}\nThe items to display in the picker must be of type `Picker.Item`.\n{% endcall %}\n\n{% call macro.prop('enabled', '?boolean = true') %}\nDetermines if the picker will be disabled, i.e., the user will not be able to make a selection.\n{% endcall %}\n\n{% call macro.prop('onValueChange', '?(value, index) => void') %}\nCallback for when an item is selected. This is called with the value and index prop of the item that was selected.\n{% endcall %}\n\n{% call macro.prop('selectedValue', '?string') %}\nSelect the item with the matching value.\n{% endcall %}\n\n{% call macro.prop('style', '?{ ...ViewProps.style, color: ?string }') %}\nSupported style properties.\n{% endcall %}\n\n### Picker.Item\n\n{% call macro.prop('color', '?string') %}\nColor of the item label. (Limited by browser support.)\n{% endcall %}\n\n{% call macro.prop('label', '?string') %}\nText to display for this item.\n{% endcall %}\n\n{% call macro.prop('testID', '?string') %}\nUsed to locate this view in end-to-end tests.\n{% endcall %}\n\n{% call macro.prop('value', '?(number | string)') %}\nThe value to be passed to the picker's `onValueChange` callback when this item is selected.\n{% endcall %}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/components/pressable.md",
    "content": "---\ntitle: Pressable\ndate: Last Modified\npermalink: /docs/pressable/index.html\neleventyNavigation:\n  key: Pressable\n  parent: Components\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nPressable is a component that can detect various parts of press interactions on any of its defined children.\n:::\n\n`Pressable` responds to touch, mouse, and keyboard interactions. The interaction state of the view is exposed to the `children` and `style` props which accept a callback as their value. The `hover` state is only activated by mouse interactions.\n\n```jsx\nimport { Pressable } from 'react-native';\n\n<Pressable {...props}>{children}</Pressable>;\n```\n\n---\n\n## API\n\n### Props\n\n{% call macro.prop('...ViewProps', '?ViewProps') %}\nAll the props supported by [View]({{ '/docs/view' | url }}).\n{% endcall %}\n\n{% call macro.prop('children', '?(any | (state: InteractionState) => any)') %}\nThe children of the view. Supports computing children as a function of interaction state.\n{% endcall %}\n\n{% call macro.prop('delayLongPress', '?number = 500') %}\nHow long to delay calling `onLongPress` after `onPressIn` is called.\n{% endcall %}\n\n{% call macro.prop('delayPressIn', '?number = 0') %}\nHow long to delay calling `onPressIn` after an interaction begins.\n{% endcall %}\n\n{% call macro.prop('delayPressOut', '?number = 0') %}\nHow long to delay calling `onPressOut` after an interaction ends.\n{% endcall %}\n\n{% call macro.prop('disabled', '?boolean') %}\nDisables all pointer interactions with the element.\n{% endcall %}\n\n{% call macro.prop('onHoverIn', '?(e: MouseEvent) => void') %}\nCalled when the pointer starts hovering over the element. Touch interactions have no effect.\n{% endcall %}\n\n{% call macro.prop('onHoverOut', '?(e: MouseEvent) => void') %}\nCalled when the pointer stops hovering over the element. Touch interactions have no effect.\n{% endcall %}\n\n{% call macro.prop('onLongPress', '?() => void') %}\nCalled when the pointer is held down for as long as the value of `delayLongPress`.\n{% endcall %}\n\n{% call macro.prop('onPress', '?(e: MouseEvent) => void') %}\nCalled when the pointer is released without first being cancelled (e.g. by a scroll that steals the responder lock). Equivalent to the `click` DOM event. \n{% endcall %}\n\n{% call macro.prop('onPressIn', '?(e: ResponderEvent) => void') %}\nCalled when the pointer starts interacting with the element after `delayPressIn` ms.\n{% endcall %}\n\n{% call macro.prop('onPressOut', '?(e: ResponderEvent) => void') %}\nCalled when the pointer stops interacting with the element after `delayPressOut` ms.\n{% endcall %}\n\n{% call macro.prop('style', '?(Style | (state: InteractionState) => Style)') %}\nThe style of the view. Supports computing style as a function of interaction state.\n{% endcall %}\n\n{% call macro.prop('testOnly_hovered', '?boolean') %}\nUsed only for documentation or testing (e.g. snapshot testing).\n{% endcall %}\n\n{% call macro.prop('testOnly_pressed', '?boolean') %}\nUsed only for documentation or testing (e.g. snapshot testing).\n{% endcall %}\n\n### InteractionState\n\nThe state object passed to function values of `children` and `state` reflects the current state of the user interaction with the view.\n\n{% call macro.prop('focused', 'boolean') %}\nWhether the view is currently focused.\n{% endcall %}\n\n{% call macro.prop('hovered', 'boolean') %}\nWhether the view is being hovered over by a mouse.\n{% endcall %}\n\n{% call macro.prop('pressed', 'boolean') %}\nWhether the view is being pressed by a pointer or keyboard interaction key.\n{% endcall %}\n\n---\n\n## Examples\n\n{{ macro.codesandbox('pressable') }}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/components/progress-bar.md",
    "content": "---\ntitle: ProgressBar\ndate: Last Modified\npermalink: /docs/progress-bar/index.html\neleventyNavigation:\n  key: ProgressBar\n  parent: Components\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nDisplay an activity progress bar.\n:::\n\n```jsx\nimport { ProgressBar } from 'react-native';\n\n<ProgressBar {...props} />;\n```\n\n---\n\n## API\n\n### Props\n\n{% call macro.prop('...ViewProps', '?ViewProps') %}\nAll the props supported by [View]({{ '/docs/view' | url }}).\n{% endcall %}\n\n{% call macro.prop('color', '?string = \"#1976D2\"') %}\nSet the background color of the button.\n{% endcall %}\n\n{% call macro.prop('indeterminate', '?boolean = false') %}\nWhether the progress bar will show indeterminate progress.\n{% endcall %}\n\n{% call macro.prop('progress', '?number = 0') %}\nThe progress value between `0` and `1`.\n{% endcall %}\n\n{% call macro.prop('trackColor', '?string = \"transparent\"') %}\nCustomize the color of the track bar.\n{% endcall %}\n\n---\n\n## Examples\n\nCustom sizes can be created using style properties.\n\n{{ macro.codesandbox('progress-bar') }}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/components/scroll-view.md",
    "content": "---\ntitle: ScrollView\ndate: Last Modified\npermalink: /docs/scroll-view/index.html\neleventyNavigation:\n  key: ScrollView\n  parent: Components\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nA scrollable view that provides integration with the pointer-locking responder system.\n:::\n\nScrollView must have a bounded height: either set the height of the view directly (discouraged) or make sure all parent views have bounded height (e.g., apply `{ flex: 1}` down the view stack).\n\n```jsx\nimport { ScrollView } from 'react-native';\n\n<ScrollView {...props}>{children}</ScrollView>;\n```\n\n---\n\n## API\n\n### Props\n\n{% call macro.prop('...ViewProps', '?ViewProps') %}\nAll the props supported by [View]({{ '/docs/view' | url }}).\n{% endcall %}\n\n{% call macro.prop('centerContent', '?boolean') %}\nWhen `true`, the scroll view automatically centers the content when the content is smaller than the scroll view bounds; when the content is larger than the scroll view, this property has no effect.\n{% endcall %}\n\n{% call macro.prop('contentContainerStyle', '?Style') %}\nThese styles will be applied to the scroll view content container which wraps all of the child views.\n{% endcall %}\n\n{% call macro.prop('disableScrollViewPanResponder', '?boolean = false') %}\nWhen `true`, the default `PanResponder` on the `ScrollView` is disabled, and full control over pointers inside the `ScrollView` is left to its child components. This is meant to be used when native \"snap-to\" scrolling behavior is needed.\n{% endcall %}\n\n{% call macro.prop('horizontal', '?boolean = false') %}\nWhen `true`, the scroll view's children are arranged horizontally in a row instead of vertically in a column.\n{% endcall %}\n\n{% call macro.prop('keyboardDismissMode', '?(\"none\" | \"on-drag\")') %}\nDetermines whether the keyboard gets dismissed in response to a scroll drag.\n{% endcall %}\n\n{% call macro.prop('onContentSizeChange', '?(width: number, height: number) => void') %}\nCalled when scrollable content view of the ScrollView changes.\n{% endcall %}\n\n{% call macro.prop('onScroll', '?(e: ScrollEvent) => void') %}\nCalled during scrolling. The frequency of the events can be controlled using the `scrollEventThrottle` prop.\n{% endcall %}\n\n{% call macro.prop('pagingEnabled', '?boolean = false') %}\nWhen `true`, the scroll view snaps to individual items in the list when scrolling.\n{% endcall %}\n\n{% call macro.prop('scrollEnabled', '?boolean = true') %}\nWhen `false`, the content does not scroll.\n{% endcall %}\n\n{% call macro.prop('scrollEventThrottle', '?number = 0') %}\nThis controls how often the scroll event will be fired while scrolling (as a time interval in ms). A lower number yields better accuracy for code that is tracking the scroll position, but can lead to scroll performance problems. The default value is `0`, which means the scroll event will be sent only once each time the view is scrolled.\n{% endcall %}\n\n{% call macro.prop('stickyHeaderIndices', '?Array<number>') %}\nAn array of child indices determining which children get docked to the top of the screen when scrolling. For example, passing `stickyHeaderIndices={0}` will cause the first child to be fixed to the top of the scroll view. This property is not supported in conjunction with the `horizontal` prop.\n{% endcall %}\n\n### ScrollEvent\n\nThe `nativeEvent` on the event passed to `onScroll` is a custom object of information related to the layout of the ScrollView.\n\n{% call macro.prop('contentOffset', '{ x: number, y: number}') %}\nHow far the scroll view is scrolled along each axis.\n{% endcall %}\n\n{% call macro.prop('contentSize', '{ height: number, width: number}') %}\nThe size of the scrollable content area.\n{% endcall %}\n\n{% call macro.prop('layoutMeasurement', '{ height: number, width: number}') %}\nThe `border-box` height and width of the scroll view.\n{% endcall %}\n\n### Instant methods\n\n{% call macro.prop('getInnerViewNode', '() => void') %}\nReturns a reference to the underlying content container DOM node within the `ScrollView`.\n{% endcall %}\n\n{% call macro.prop('getScrollableNode', '() => void') %}\nReturns a reference to the underlying scrollable DOM node.\n{% endcall %}\n\n{% call macro.prop('getScrollResponder', '() => void') %}\nReturns a reference to the underlying scroll responder, which supports operations like `scrollTo()`. All `ScrollView`-like components should implement this method so that they can be composed while providing access to the underlying scroll responder's methods.\n{% endcall %}\n\n{% call macro.prop('scrollTo', '(options?: { x: number, y: number, animated: boolean }) => void') %}\nScrolls to a given `x`, `y` offset (animation depends on browser support for scroll-behavior).\n{% endcall %}\n\n{% call macro.prop('scrollToEnd', '(options?: { animated: boolean }) => void') %}\nScrolls to the end of the scroll view.\n{% endcall %}\n\n---\n\n## Examples\n\n{{ macro.codesandbox('scroll-view') }}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/components/switch.md",
    "content": "---\ntitle: Switch\ndate: Last Modified\npermalink: /docs/switch/index.html\neleventyNavigation:\n  key: Switch\n  parent: Components\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nA controlled component that renders a boolean input.\n:::\n\n`Switch` requires an onValueChange callback that updates the value prop in order for the component to reflect user actions. If the value prop is not updated, the component will continue to render the supplied value prop instead of the expected result of any user actions.\n\n```jsx\nimport { Switch } from 'react-native';\n\n<Switch {...props} />;\n```\n\n---\n\n## API\n\n### Props\n\n{% call macro.prop('...ViewProps', '?ViewProps') %}\nAll the props supported by [View]({{ '/docs/view' | url }}).\n{% endcall %}\n\n{% call macro.prop('activeThumbColor', '?string = \"#009688\"') %}\nThe color of the thumb grip when the switch is turned on. (Web-only)\n{% endcall %}\n\n{% call macro.prop('activeTrackColor', '?string = \"#A3D3CF\"') %}\nThe color of the track when the switch is turned on. (Web-only)\n{% endcall %}\n\n{% call macro.prop('disabled', '?boolean') %}\nDisables interactions with the element. If `true`, the user won't be able to interact with the switch.\n{% endcall %}\n\n{% call macro.prop('onValueChange', '?(boolean) => void') %}\nInvoked with the new value when the value changes.\n{% endcall %}\n\n{% call macro.prop('thumbColor', '?string = \"#FAFAFA\"') %}\nThe color of the thumb grip when the switch is turned off.\n{% endcall %}\n\n{% call macro.prop('trackColor', '?string => \"#939393\"') %}\nThe color of the track when the switch is turned off.\n{% endcall %}\n\n{% call macro.prop('value', '?boolean = false') %}\nThe value of the switch. If `true` the switch will be turned on.\n{% endcall %}\n\n---\n\n## Examples\n\nCustom sizes can be created using styles.\n\n{{ macro.codesandbox('switch') }}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/components/text-input.md",
    "content": "---\ntitle: TextInput\ndate: Last Modified\npermalink: /docs/text-input/index.html\neleventyNavigation:\n  key: TextInput\n  parent: Components\n  label: 'Change'\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nAccessible single- and multi-line text input via a keyboard.\n:::\n\nSupports features such as auto-complete, auto-focus, placeholder text, and event callbacks. Note: some props are exclusive to or excluded from `multiline`.\n\n```jsx\nimport { TextInput } from 'react-native-web';\n\n<TextInput {...props} />;\n```\n\n---\n\n## API\n\n### Props\n\n{% call macro.prop('...AccessibilityProps') %}\nThe [accessibility props]({{ '/docs/accessibility' | url }}).\n{% endcall %}\n\n{% call macro.prop('...PointerProps') %}\nThe [PointerEvent props]({{ '/docs/interactions' | url }}).\n{% endcall %}\n\n{% call macro.prop('...FocusProps') %}\nThe [FocusEvent props]({{ '/docs/interactions' | url }}).\n{% endcall %}\n\n{% call macro.prop('...KeyboardProps') %}\nThe [KeyboardEvent props]({{ '/docs/interactions' | url }}).\n{% endcall %}\n\n{% call macro.prop('autoCapitalize', '?string') %}\nEquivalent to [HTMLElement.autocapitalize](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocapitalize).\n{% endcall %}\n\n{% call macro.prop('autoComplete', '?string') %}\nEquivalent to [HTMLElement.autocomplete](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autocomplete).\n{% endcall %}\n\n{% call macro.prop('autoCorrect', '?boolean = true') %}\nA string indicating whether or not auto-correct behavior is on or off. Safari only.\n{% endcall %}\n\n{% call macro.prop('autoFocus', '?boolean = false') %}\nIf `true`, focuses the input on mount. Only the first form element in a document with auto-focus is focused.\n{% endcall %}\n\n{% call macro.prop('blurOnSubmit', '?boolean') %}\nIf `true`, the text field will blur when submitted. The default value is `true` for single-line fields and `false` for multiline fields. Note, for multiline fields setting `blurOnSubmit` to `true` means that pressing return will blur the field and trigger the `onSubmitEditing` event instead of inserting a newline into the field.\n{% endcall %}\n\n{% call macro.prop('clearTextOnFocus', '?boolean = false') %}\nIf `true`, clears the text field automatically when focused.\n{% endcall %}\n\n{% call macro.prop('dataSet', '?Object') %}\nEquivalent to [HTMLElement.dataset](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/dataset).\n{% endcall %}\n\n{% call macro.prop('defaultValue', '?string') %}\nThe initial value of the input. Useful for simple use-cases where you don't want to deal with listening to events and updating the value prop to keep the controlled state in sync.\n{% endcall %}\n\n{% call macro.prop('dir', '?(\"auto\" | \"ltr\" | \"rtl\") = \"auto\"') %}\nEquivalent to [HTMLElement.dir](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dir).\n{% endcall %}\n\n{% call macro.prop('disabled', '?boolean = false') %}\nEquivalent to [HTMLElement.disabled](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled)\n{% endcall %}\n\n{% call macro.prop('enterKeyHint', '?string') %}\nSpecifies what action label (or icon) to present for the enter key on virtual keyboards. Equivalent to [HTMLElement.enterkeyhint](https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-enterkeyhint-attribute)\n{% endcall %}\n\n{% call macro.prop('id', '?string') %}\nEquivalent to [HTMLElement.id](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).\n{% endcall %}\n\n{% call macro.prop('inputMode', '?string') %}\nHints at the type of data that might be entered by the user while editing the element or its contents. Equivalent to [HTMLElement.inputMode](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode). Safari iOS requires an ancestral `<form action>` element to display the search keyboard. (Not available when multiline is true.)\n{% endcall %}\n\n{% call macro.prop('lang', '?string') %}\nEquivalent to [HTMLElement.lang](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang). This prop is used to infer writing direction if no `dir` is set.\n{% endcall %}\n\n{% call macro.prop('maxLength', '?string') %}\nEquivalent to [HTMLElement.maxlength](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/maxlength).\n{% endcall %}\n\n{% call macro.prop('multiline', '?boolean = false') %}\nIf `true`, the text input can be multiple lines.\n{% endcall %}\n\n{% call macro.prop('onChange', '?(e: ChangeEvent) => void') %}\nEquivalent to the React DOM `ChangeEvent`.\n{% endcall %}\n\n{% call macro.prop('onChangeText', '?(text: string) => void') %}\nCalled when the text content of the input changes.\n{% endcall %}\n\n{% call macro.prop('onContentSizeChange', '?({ nativeEvent: { contentSize: { width, height } } }) => void') %}\nCallback that is called when the text input's content size changes.\n{% endcall %}\n\n{% call macro.prop('onKeyPress', '?(e: KeyboardEvent) => void') %}\nEquivalent to the [onKeyDown prop]({{ '/docs/interactions' | url }}).\n{% endcall %}\n\n{% call macro.prop('onLayout', '?({ nativeEvent: { layout: { x, y, width, height } } }) => void') %}\nThis is invoked when a component is mounted and when its layout changes. `x` and `y` are the offsets from the parent node.\n{% endcall %}\n\n{% call macro.prop('onScroll', '?(e: ScrollEvent) => void') %}\nCalled during scrolling.\n{% endcall %}\n\n{% call macro.prop('onSelectionChange', '?({ nativeEvent: { selection: { start, end } } }) => void') %}\nCallback that is called when the text input's selection changes.\n{% endcall %}\n\n{% call macro.prop('onSubmitEditing', '?() => void') %}\nCallback that is called when the keyboard's submit button is pressed. When `multiline={true}`, this is only called if `blurOnSubmit={true}`.\n{% endcall %}\n\n{% call macro.prop('placeholder', '?boolean') %}\nText that appears in the form control when it has no value set.\n{% endcall %}\n\n{% call macro.prop('placeholderTextColor', '?string') %}\nEquivalent to defining `::placeholder { color }` via a CSS property.\n{% endcall %}\n\n{% call macro.prop('readOnly', '?boolean = false') %}\nEquivalent to [HTMLElement.readonly](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly)\n{% endcall %}\n\n{% call macro.prop('rows', '?number = 1') %}\nSets the number of lines for a multiline input. (Requires `multiline` to be `true`.)\n{% endcall %}\n\n{% call macro.prop('secureTextEntry', '?boolean = false') %}\nSet to `true` for passwords and other sensitive data. Equivalent to HTMLInputElement [\"password\" `type`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/password). (Not available when `multiline` is `true`.)\n{% endcall %}\n\n{% call macro.prop('selectTextOnFocus', '?boolean = false') %}\nIf `true`, all text will automatically be selected on focus.\n{% endcall %}\n\n{% call macro.prop('spellCheck', '?boolean') %}\nEquivalent to [HTMLElement.spellcheck](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck)\n{% endcall %}\n\n{% call macro.prop('showSoftInputOnFocus', '?boolean = true') %}\nIf `false`, will set [HTMLElement.virtualkeyboardpolicy](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/virtualkeyboardpolicy) to `manual`.\n{% endcall %}\n\n{% call macro.prop('style', '?Style') %}\nSet the styles of the view. `TextInput` supports typographic styles in addition to those of `View`.\n{% endcall %}\n\n{% call macro.prop('testID', '?string') %}\nSet the test selector label (via `data-testid`).\n{% endcall %}\n\n{% call macro.prop('value', '?string') %}\nThe value of the input when using it as a controlled component.\n{% endcall %}\n\n### Instance methods\n\n{% call macro.prop('blur', '() => void') %}\nBlur the underlying DOM input.\n{% endcall %}\n\n{% call macro.prop('clear', '() => void') %}\nClear the text from the underlying DOM input.\n{% endcall %}\n\n{% call macro.prop('focus', '() => void') %}\nFocus the underlying DOM input.\n{% endcall %}\n\n{% call macro.prop('isFocused', '() => boolean') %}\nReturns `true` if the input is currently focused; `false` otherwise.\n{% endcall %}\n\n---\n\n## Examples\n\n{{ macro.codesandbox('text-input') }}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/components/text.md",
    "content": "---\ntitle: Text\ndate: Last Modified\npermalink: /docs/text/index.html\neleventyNavigation:\n  key: Text\n  parent: Components\n  label: \"Change\"\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nThe fundamental text primitive. `Text` inherits typographic styles from ancestor `Text` elements.\n:::\n\n`Text` has built in accessibility controls, enforces inline layout by default, provides limited inheritance of text styles, and supports `View` as children. It inherits typographic styles from ancestor `Text` elements (as long as the chain of text elements is not interrupted by a `View`). By default, text is rendered using the native platform’s algorithm to determine the directionality of the content language.\n\n```jsx\nimport { Text } from 'react-native';\n\n<Text {...props}>{children}</Text>;\n```\n\n::: callout\n**Did you know?** Text styling in {{ site.name }} has stricter rules than it does on the web. Read the [Styling]({{ '/docs/styling' | url }}) guide to learn more.\n:::\n\n---\n\n## API\n\n### Props\n\n{% call macro.prop('...AccessibilityProps') %}\nThe [accessibility props]({{ '/docs/accessibility' | url }}).\n{% endcall %}\n\n{% call macro.prop('...PointerProps') %}\nThe [PointerEvent props]({{ '/docs/interactions' | url }}).\n{% endcall %}\n\n{% call macro.prop('...FocusProps') %}\nThe [FocusEvent props]({{ '/docs/interactions' | url }}).\n{% endcall %}\n\n{% call macro.prop('...KeyboardProps') %}\nThe [KeyboardEvent props]({{ '/docs/interactions' | url }}).\n{% endcall %}\n\n{% call macro.prop('...ResponderProps') %}\nThe [ResponderEvent props]({{ '/docs/interactions' | url }}).\n{% endcall %}\n\n{% call macro.prop('children', 'any') %}\nThe children of a `Text` element can be strings as well as other elements like `<View />` and `<Image />`. Nested text components will inherit the typographic styles of their parents.\n{% endcall %}\n\n{% call macro.prop('dataSet', '?Object') %}\nEquivalent to [HTMLElement.dataset](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/dataset).\n{% endcall %}\n\n{% call macro.prop('dir', '?(\"auto\" | \"ltr\" | \"rtl\") = \"auto\"') %}\nEquivalent to [HTMLElement.dir](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dir). The default value of `\"auto\"` is not set on *nested* text elements.\n{% endcall %}\n\n{% call macro.prop('href', '?string') %}\nIf `href` is defined, the view is rendered as an anchor tag pointing to this URL.\n{% endcall %}\n\n{% call macro.prop('hrefAttrs', '?Object') %}\nIf `href` is defined, this prop defines related attributes to include on the anchor (e.g., `download`, `rel`, `target`) which may modify its behavior.\n{% endcall %}\n\n{% call macro.prop('id', '?string') %}\nEquivalent to [HTMLElement.id](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).\n{% endcall %}\n\n{% call macro.prop('lang', '?string') %}\nEquivalent to [HTMLElement.lang](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang). This prop is used to infer writing direction if no `dir` is set.\n{% endcall %}\n\n{% call macro.prop('numberOfLines', '?number') %}\nTruncates the text with an ellipsis after this many lines.\n{% endcall %}\n\n{% call macro.prop('onLayout', '?({ nativeEvent: { layout: { x, y, width, height } } }) => void') %}\nThis is invoked when a component is mounted and when its layout changes. `x` and `y` are the offsets from the parent node.\n{% endcall %}\n\n{% call macro.prop('style', '?Style') %}\nSet the styles of the text. `Text` supports typographic styles in addition to those of `View`.\n{% endcall %}\n\n{% call macro.prop('tabIndex', '0 | -1') %}\nSet whether the view can receive keyboard focus.\n{% endcall %}\n\n{% call macro.prop('testID', '?string') %}\nSet the test selector label (via `data-testid`).\n{% endcall %}\n\n---\n\n## Examples\n\n{{ macro.codesandbox('text') }}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/components/view.md",
    "content": "---\ntitle: View\ndate: Last Modified\npermalink: /docs/view/index.html\neleventyNavigation:\n  key: View\n  parent: Components\n  label: \"Change\"\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nThe fundamental layout primitive.\n:::\n\nView uses a flexbox column layout by default. Every instance of `View` uses relative positioning by default and the `zIndex` can only be used to control the relative Z-axis stacking of siblings within their parent.\n\nRaw text nodes are **not** allowed as children of View. A View nested within a Text will render inline without altering its display or that of its children.\n\n```jsx\nimport { View } from 'react-native';\n\n<View {...props}>{children}</View>;\n```\n\n:::callout\n**Did you know?** `View` elements do not support text content or text styles. Style properties like `fontFamily` are only supported on `Text` and `TextInput` elements.\n:::\n\n---\n\n## API\n\n### Props\n\n{% call macro.prop('...AccessibilityProps') %}\nThe [accessibility props]({{ '/docs/accessibility' | url }}).\n{% endcall %}\n\n{% call macro.prop('...PointerProps') %}\nThe [PointerEvent props]({{ '/docs/interactions' | url }}).\n{% endcall %}\n\n{% call macro.prop('...FocusProps') %}\nThe [FocusEvent props]({{ '/docs/interactions' | url }}).\n{% endcall %}\n\n{% call macro.prop('...KeyboardProps') %}\nThe [KeyboardEvent props]({{ '/docs/interactions' | url }}).\n{% endcall %}\n\n{% call macro.prop('...ResponderProps') %}\nThe [ResponderEvent props]({{ '/docs/interactions' | url }}).\n{% endcall %}\n\n{% call macro.prop('children', 'any') %}\nThe children of a `View` element can be other elements and must *not* include strings (or components that render down to strings).\n{% endcall %}\n\n{% call macro.prop('dataSet', '?Object') %}\nEquivalent to [HTMLElement.dataset](https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/dataset).\n{% endcall %}\n\n{% call macro.prop('dir', '?(\"ltr\" | \"rtl\")') %}\nEquivalent to [HTMLElement.dir](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir).\n{% endcall %}\n\n{% call macro.prop('href', '?string') %}\nIf `href` is defined, the view is rendered as an anchor tag pointing to this URL.\n{% endcall %}\n\n{% call macro.prop('hrefAttrs', '?Object') %}\nIf `href` is defined, this prop defines related attributes to include on the anchor (e.g., `download`, `rel`, `target`) which may modify its behavior.\n{% endcall %}\n\n{% call macro.prop('id', '?string') %}\nEquivalent to [HTMLElement.id](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).\n{% endcall %}\n\n{% call macro.prop('lang', '?string') %}\nEquivalent to [HTMLElement.lang](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang). This prop is used to infer writing direction if no `dir` is set.\n{% endcall %}\n\n{% call macro.prop('onLayout', '?({ nativeEvent: { layout: { x, y, width, height } } }) => void') %}\nThis is invoked when a component is mounted and when its layout changes. `x` and `y` are the offsets from the parent node.\n{% endcall %}\n\n{% call macro.prop('style', '?Style') %}\nSet the styles of the view.\n{% endcall %}\n\n{% call macro.prop('tabIndex', '0 | -1') %}\nSet whether the view can receive keyboard focus.\n{% endcall %}\n\n{% call macro.prop('testID', '?string') %}\nSet the test selector label (via `data-testid`).\n{% endcall %}\n\n---\n\n## Examples\n\n{{ macro.codesandbox('view') }}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/concepts/_.md",
    "content": "---\ntitle: Main concepts\ndate: Last Modified\npermalink: false\neleventyNavigation:\n  key: Concepts\n  title: Main concepts\n  order: 10\n---\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/concepts/accessibility.md",
    "content": "---\ntitle: Accessibility\ndate: Last Modified\npermalink: /docs/accessibility/index.html\neleventyNavigation:\n  key: Accessibility\n  parent: Concepts\n  label: \"Change\"\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nFamiliar web accessibility APIs in a platform-agnostic form.\n:::\n\nAccessibility in {{ site.name }} combines several separate web APIs into a cohesive system. Assistive technologies (e.g., VoiceOver, TalkBack screen readers) derive useful information about the structure, purpose, and interactivity of web apps from their [HTML elements][html-accessibility-url], attributes, and [ARIA in HTML][aria-in-html-url].\n\n---\n\n## Accessibility Props API\n\n{{ site.name }} includes APIs for making accessible apps. (Note that for compatibility with existing React Native code, the React Native-specific `accessibility*` props are also supported.)\n\n{% call macro.prop('aria-activedescendant', '?string') %}\nEquivalent to [aria-activedescendant](https://www.w3.org/TR/wai-aria-1.2/#aria-activedescendant).\n{% endcall %}\n\n{% call macro.prop('aria-atomic', '?boolean') %}\nEquivalent to [aria-atomic](https://www.w3.org/TR/wai-aria-1.2/#aria-atomic).\n{% endcall %}\n\n{% call macro.prop('aria-autocomplete', '?string') %}\nEquivalent to [aria-autocomplete](https://www.w3.org/TR/wai-aria-1.2/#aria-autocomplete).\n{% endcall %}\n\n{% call macro.prop('aria-busy', '?boolean') %}\nEquivalent to [aria-busy](https://www.w3.org/TR/wai-aria-1.2/#aria-busy).\n{% endcall %}\n\n{% call macro.prop('aria-checked', '?(boolean | \"mixed\")') %}\nEquivalent to [aria-checked](https://www.w3.org/TR/wai-aria-1.2/#aria-checked).\n{% endcall %}\n\n{% call macro.prop('aria-colcount', '?number') %}\nEquivalent to [aria-colcount](https://www.w3.org/TR/wai-aria-1.2/#aria-colcount).\n{% endcall %}\n\n{% call macro.prop('aria-colindex', '?number') %}\nEquivalent to [aria-colindex](https://www.w3.org/TR/wai-aria-1.2/#aria-colindex).\n{% endcall %}\n\n{% call macro.prop('aria-colspan', '?number') %}\nEquivalent to [aria-colspan](https://www.w3.org/TR/wai-aria-1.2/#aria-colspan).\n{% endcall %}\n\n{% call macro.prop('aria-controls', '?string') %}\nEquivalent to [aria-controls](https://www.w3.org/TR/wai-aria-1.2/#aria-controls).\n{% endcall %}\n\n{% call macro.prop('aria-current', '?(boolean | \"page\" | \"step\" | \"location\" | \"date\" | \"time\")') %}\nEquivalent to [aria-current](https://www.w3.org/TR/wai-aria-1.2/#aria-current).\n{% endcall %}\n\n{% call macro.prop('aria-describedby', '?string') %}\nEquivalent to [aria-describedby](https://www.w3.org/TR/wai-aria-1.2/#aria-describedby).\n{% endcall %}\n\n{% call macro.prop('aria-details', '?string') %}\nEquivalent to [aria-details](https://www.w3.org/TR/wai-aria-1.2/#aria-details).\n{% endcall %}\n\n{% call macro.prop('aria-disabled', '?boolean') %}\nEquivalent to [aria-disabled](https://www.w3.org/TR/wai-aria-1.2/#aria-disabled).\n{% endcall %}\n\n{% call macro.prop('aria-errormessage', '?string') %}\nEquivalent to [aria-errormessage](https://www.w3.org/TR/wai-aria-1.2/#aria-errormessage).\n{% endcall %}\n\n{% call macro.prop('aria-expanded', '?boolean') %}\nEquivalent to [aria-expanded](https://www.w3.org/TR/wai-aria-1.2/#aria-expanded).\n{% endcall %}\n\n{% call macro.prop('aria-flowto', '?string') %}\nEquivalent to [aria-flowto](https://www.w3.org/TR/wai-aria-1.2/#aria-flowto).\n{% endcall %}\n\n{% call macro.prop('aria-haspopup', '?string') %}\nEquivalent to [aria-haspopup](https://www.w3.org/TR/wai-aria-1.2/#aria-haspopup).\n{% endcall %}\n\n{% call macro.prop('aria-hidden', '?boolean') %}\nEquivalent to [aria-hidden](https://www.w3.org/TR/wai-aria-1.2/#aria-hidden).\n{% endcall %}\n\n{% call macro.prop('aria-invalid', '?boolean') %}\nEquivalent to [aria-invalid](https://www.w3.org/TR/wai-aria-1.2/#aria-invalid).\n{% endcall %}\n\n{% call macro.prop('aria-keyshortcuts', '?string') %}\nEquivalent to [aria-keyshortcuts](https://www.w3.org/TR/wai-aria-1.2/#aria-keyshortcuts).\n{% endcall %}\n\n{% call macro.prop('aria-label', '?string') %}\nEquivalent to [aria-label](https://www.w3.org/TR/wai-aria-1.2/#aria-label).\n{% endcall %}\n\n{% call macro.prop('aria-labelledby', '?string') %}\nEquivalent to [aria-labelledby](https://www.w3.org/TR/wai-aria-1.2/#aria-labelledby).\n{% endcall %}\n\n{% call macro.prop('aria-level', '?number') %}\nEquivalent to [aria-level](https://www.w3.org/TR/wai-aria-1.2/#aria-level).\n{% endcall %}\n\n{% call macro.prop('aria-live', '?(\"assertive\" | \"off\" | \"polite\")') %}\nEquivalent to [aria-live](https://www.w3.org/TR/wai-aria-1.2/#aria-live).\n{% endcall %}\n\n{% call macro.prop('aria-modal', '?boolean') %}\nEquivalent to [aria-modal](https://www.w3.org/TR/wai-aria-1.2/#aria-modal).\n{% endcall %}\n\n{% call macro.prop('aria-multiline', '?boolean') %}\nEquivalent to [aria-multiline](https://www.w3.org/TR/wai-aria-1.2/#aria-multiline).\n{% endcall %}\n\n{% call macro.prop('aria-multiselectable', '?boolean') %}\nEquivalent to [aria-multiselectable](https://www.w3.org/TR/wai-aria-1.2/#aria-multiselectable).\n{% endcall %}\n\n{% call macro.prop('aria-orientation', '?(\"horizontal\" | \"vertical\")') %}\nEquivalent to [aria-orientation](https://www.w3.org/TR/wai-aria-1.2/#aria-orientation).\n{% endcall %}\n\n{% call macro.prop('aria-owns', '?string') %}\nEquivalent to [aria-owns](https://www.w3.org/TR/wai-aria-1.2/#aria-owns).\n{% endcall %}\n\n{% call macro.prop('aria-placeholder', '?string') %}\nEquivalent to [aria-placeholder](https://www.w3.org/TR/wai-aria-1.2/#aria-placeholder).\n{% endcall %}\n\n{% call macro.prop('aria-posinset', '?number') %}\nEquivalent to [aria-posinset](https://www.w3.org/TR/wai-aria-1.2/#aria-posinset).\n{% endcall %}\n\n{% call macro.prop('aria-pressed', '?boolean') %}\nEquivalent to [aria-pressed](https://www.w3.org/TR/wai-aria-1.2/#aria-pressed).\n{% endcall %}\n\n{% call macro.prop('aria-readonly', '?boolean') %}\nEquivalent to [aria-readonly](https://www.w3.org/TR/wai-aria-1.2/#aria-readonly).\n{% endcall %}\n\n{% call macro.prop('aria-required', '?boolean') %}\nEquivalent to [aria-required](https://www.w3.org/TR/wai-aria-1.2/#aria-required).\n{% endcall %}\n\n{% call macro.prop('role', '?string') %}\nEquivalent to [role](https://www.w3.org/TR/wai-aria-1.2/#role_definitions).\n{% endcall %}\n\n{% call macro.prop('aria-roledescription', '?string') %}\nEquivalent to [aria-roledescription](https://www.w3.org/TR/wai-aria-1.2/#aria-roledescription).\n{% endcall %}\n\n{% call macro.prop('aria-rowcount', '?number') %}\nEquivalent to [aria-rowcount](https://www.w3.org/TR/wai-aria-1.2/#aria-rowcount).\n{% endcall %}\n\n{% call macro.prop('aria-rowindex', '?number') %}\nEquivalent to [aria-rowindex](https://www.w3.org/TR/wai-aria-1.2/#aria-rowindex).\n{% endcall %}\n\n{% call macro.prop('aria-rowspan', '?number') %}\nEquivalent to [aria-rowspan](https://www.w3.org/TR/wai-aria-1.2/#aria-rowspan).\n{% endcall %}\n\n{% call macro.prop('aria-selected', '?boolean') %}\nEquivalent to [aria-selected](https://www.w3.org/TR/wai-aria-1.2/#aria-selected).\n{% endcall %}\n\n{% call macro.prop('aria-setsize', '?number') %}\nEquivalent to [aria-setsize](https://www.w3.org/TR/wai-aria-1.2/#aria-setsize).\n{% endcall %}\n\n{% call macro.prop('aria-sort', '?(\"ascending\" | \"descending\" | \"none\" | \"other\")') %}\nEquivalent to [aria-sort](https://www.w3.org/TR/wai-aria-1.2/#aria-sort).\n{% endcall %}\n\n{% call macro.prop('aria-valuemax', '?number') %}\nEquivalent to [aria-valuemax](https://www.w3.org/TR/wai-aria-1.2/#aria-valuemax).\n{% endcall %}\n\n{% call macro.prop('aria-valuemin', '?number') %}\nEquivalent to [aria-valuemin](https://www.w3.org/TR/wai-aria-1.2/#aria-valuemin).\n{% endcall %}\n\n{% call macro.prop('aria-valuenow', '?number') %}\nEquivalent to [aria-valuenow](https://www.w3.org/TR/wai-aria-1.2/#aria-valuenow).\n{% endcall %}\n\n{% call macro.prop('aria-valuetext', '?string') %}\nEquivalent to [aria-valuetext](https://www.w3.org/TR/wai-aria-1.2/#aria-valuetext).\n{% endcall %}\n\n---\n\n## Accessibility patterns\n\n### Links\n\nThe `Text` and `View` components can be rendered as links. If the `href` prop is set, the element will render `<a>` tags without altering the presentation of the element.\n\n```jsx\n<Text href=\"/\" />\n// <a href=\"/\" ></a>\n```\n\nThe `hrefAttrs` prop sets link-related attributes.\n\n```jsx\nconst hrefAttrs = { download: true, rel: \"nofollow\", target: \"blank\" };\n\n<Text\n  href=\"/document.pdf\"\n  hrefAttrs={hrefAttrs}\n/>\n// <a download href=\"/document.pdf\" rel=\"nofollow\" target=\"_blank\"></a>\n```\n\n### Keyboard focus\n\nThe `tabIndex` prop determines whether a component is user-focusable and appears in the keyboard tab flow. This prop should be used instead of the `accessible` (or `focusable` prop) found in React Native for Android/iOS, which is not implemented by React Native for Web/Windows/macOS.\n\n```jsx\n<View tabindex={0} />\n// <div tabindex=\"0\"></div>\n\n<Text tabindex={-1} href=\"/\" />\n// <a href=\"/\" tabindex=\"-1\"></a>\n```\n\n:::callout\n**Did you know?** Any element (including elements not in the keyboard tab flow) can be programmatically focused via `UIManager.focus(viewRef.current)`.\n:::\n\n### Accessible HTML\n\n{{ site.name }} components express semantics exclusively via the `aria-*` props.\n\n```jsx\n<View\n  aria-label=\"...\"\n  aria-pressed={false}\n  id=\"abc\"\n  role=\"menuitem\"\n/>\n/*\n<div\n  aria-label=\"...\"\n  aria-pressed=\"false\"\n  id=\"abc\"\n  role=\"menuitem\"\n/>\n*/\n```\n\n### Semantic HTML\n\nThe value of the `role` prop is used to infer an [analogous HTML element][html-aria-url] where appropriate. This is done to rely on well-supported native mechanisms for encoding semantics and accessibility information.\n\n```jsx\n<View role=\"article\">\n  <Text role=\"paragraph\">This is an article</Text>\n</View>\n/*\n<article>\n  <p>This is an article</p>\n</article>\n*/\n```\n\nIf the `\"heading\"` role is combined with an `aria-level`, the equivalent HTML heading element is rendered. Otherwise, it is rendered as `<h1>`.\n\n```jsx\n<Text role=\"heading\" /> /* <h1> */\n<Text role=\"heading\" aria-level={2} /> /* <h2> */\n```\n\nNote: Avoid changing `role` values over time or after user actions. Generally, accessibility APIs do not provide a means of notifying assistive technologies if a `role` changes.\n\n\n[aria-in-html-url]: https://w3c.github.io/aria-in-html/\n[html-accessibility-url]: http://www.html5accessibility.com/\n[html-aria-url]: http://www.w3.org/TR/html-aria/\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/concepts/interactions.md",
    "content": "---\ntitle: Interactions\ndate: Last Modified\npermalink: /docs/interactions/index.html\neleventyNavigation:\n  key: Interactions\n  parent: Concepts\n  label: \"Change\"\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nInteractions and gestures for the web.\n:::\n\n{{ site.name }} extends the interaction modes available in React Native to account for mouse, touch, and keyboard use. The Responder System is available for more advanced gesture recognition.\n\n---\n\n## PointerEvent Props API\n\nPointer interactions are available on supporting elements. These events are React DOM synthetic mouse events. The `click` events may be dispatched by the browser following user interactions with a pointer (mouse or touch) as well as a keyboard.\n\nIn cases where a native `click` is not dispatched following a valid keyboard interaction (due to the native semantics of the host element), it will be emulated by React Native for Web. This helps to improve the accessibility of elements for all forms of interaction hardware.\n\n{% call macro.prop('onClick', '?(event: PointerEvent) => void') %}\nCalled when the element is clicked.\n{% endcall %}\n\n{% call macro.prop('onClickCapture', '?(event: PointerEvent) => void') %}\nCalled when the element is clicked. (Capture phase.)\n{% endcall %}\n\n{% call macro.prop('onContextMenu', '?(event: PointerEvent) => void') %}\nCalled when a native context menu is displayed. This may be in response to mouse, touch, or mouse+keyboard interaction.\n{% endcall %}\n\n{% call macro.prop('onPointer*', '?(event: PointerEvent) => void') %}\nSupport for the PointerEvent API.\n{% endcall %}\n\n---\n\n## FocusEvent Props API\n\nFocus interactions are available on supporting elements. The focus events are React DOM synthetic focus events. These events are also fired in response to focus being programmatically moved.\n\n{% call macro.prop('onBlur', '?(event: FocusEvent) => void') %}\nCalled when the element loses focus.\n{% endcall %}\n\n{% call macro.prop('onFocus', '?(event: FocusEvent) => void') %}\nCalled when the element receives focus.\n{% endcall %}\n\n---\n\n## KeyboardEvent Props API\n\nKeyboard interactions are available on supporting elements. The keyboard events are React DOM synthetic keyboard events.\n\n{% call macro.prop('onKeyDown', '?(event: KeyboardEvent) => void') %}\nCalled when a key is pressed down.\n{% endcall %}\n\n{% call macro.prop('onKeyDownCapture', '?(event: KeyboardEvent) => void') %}\nCalled when a key is pressed down. (Capture phase.)\n{% endcall %}\n\n{% call macro.prop('onKeyUp', '?(event: KeyboardEvent) => void') %}\nCalled when a key is released.\n{% endcall %}\n\n{% call macro.prop('onKeyUpCapture', '?(event: KeyboardEvent) => void') %}\nCalled when a key is released. (Capture phase.)\n{% endcall %}\n\n---\n\n## ResponderEvent Props API\n\n\"Responder\" interactions are available on supporting elements. The Responder System allows views and gesture recognizers to opt-in to negotiating over a single, global “interaction lock”. For a view to become the “responder” means that pointer interactions are exclusive to that view and none other. A view can negotiate to become the “responder” without requiring knowledge of other views. A more specialized API for working with multi-pointer gestures is available by using the [PanResponder]({{ '/docs/pan-responder' | url }}) module.\n\nA view can become the \"responder\" after the following native events: `scroll`, `touchstart`, `touchmove`, `mousedown`, `mousemove`. If nothing is already the \"responder\", the event propagates to (capture) and from (bubble) the event target until a view returns `true` for `on*SetResponder(Capture)`. If a view is *currently* the responder, the negotiation event propagates to (capture) and from (bubble) the lowest common ancestor of the event target and the current responder. Then negotiation happens between the current responder and the view that wants to become the responder.\n\nNOTE: For historical reasons (originating from React Native), mouse interactions are represented as a single `touch`.\n\n### Negotiation props\n\nA view can become the responder by using the negotiation callbacks. During the capture phase the deepest node is called last. During the bubble phase the deepest node is called first. The capture phase should be used when a view wants to prevent a descendant from becoming the responder. The first view to return `true` from any of the `on*ShouldSetResponderCapture` / `on*ShouldSetResponder` callbacks will either become the responder or enter into negotiation with the existing responder.\n\nN.B. If `stopPropagation` is called on the event for any of the negotiation callbacks, it only stops further negotiation within the Responder System. It will not stop the propagation of the native event (which has already bubbled to the `document` by this time.)\n\n{% call macro.prop('onStartShouldSetResponder', '?(event: ResponderEvent) => boolean') %}\nOn `pointerdown`, should this view attempt to become the responder? If the view is not the responder, this callback may be called for every pointer start on the view.\n{% endcall %}\n\n{% call macro.prop('onStartShouldSetResponderCapture', '?(event: ResponderEvent) => boolean') %}\nOn `pointerdown`, should this view attempt to become the responder during the capture phase? If the view is not the responder, this callback may be called for every pointer start on the view.\n{% endcall %}\n\n{% call macro.prop('onMoveShouldSetResponder', '?(event: ResponderEvent) => boolean') %}\nOn `pointermove` for an active pointer, should this view attempt to become the responder? If the view is not the responder, this callback may be called for every pointer move on the view.\n{% endcall %}\n\n{% call macro.prop('onMoveShouldSetResponderCapture', '?(event: ResponderEvent) => boolean') %}\nOn `pointermove` for an active pointer, should this view attempt to become the responder during the capture phase? If the view is not the responder, this callback may be called for every pointer move on the view.\n{% endcall %}\n\n{% call macro.prop('onScrollShouldSetResponder', '?(event: ResponderEvent) => boolean') %}\nOn `scroll`, should this view attempt to become the responder? If the view is not the responder, this callback may be called for every scroll of the view.\n{% endcall %}\n\n{% call macro.prop('onScrollShouldSetResponderCapture', '?(event: ResponderEvent) => boolean') %}\nOn `scroll`, should this view attempt to become the responder during the capture phase? If the view is not the responder, this callback may be called for every scroll of the view.\n{% endcall %}\n\n{% call macro.prop('onResponderTerminationRequest', '?(event: ResponderEvent) => boolean') %}\nThe view is the responder, but another view now wants to become the responder. Should this view release the responder? Returning `true` allows the responder to be released.\n{% endcall %}\n\n### Transfer props\n\nIf a view returns `true` for a negotiation callback then it will either become the responder (if none exists) or be involved in the responder transfer. The following callbacks are called only for the views involved in the responder transfer (i.e., no bubbling.)\n\n{% call macro.prop('onResponderGrant', '?(event: ResponderEvent) => void') %}\nThe view is granted the responder and is now responding to pointer events. The lifecycle callbacks will be called for this view. This is the point at which you should provide visual feedback for users that the interaction has begun.\n{% endcall %}\n\n{% call macro.prop('onResponderReject', '?(event: ResponderEvent) => void') %}\nThe view was not granted the responder. It was rejected because another view is already the responder and will not release it.\n{% endcall %}\n\n{% call macro.prop('onResponderTerminate', '?(event: ResponderEvent) => void') %}\nThe responder has been taken from this view. It may have been taken by another view after a call to `onResponderTerminationRequest`, or it might have been taken by the browser without asking (e.g., window blur, document scroll, context menu open). This is the point at which you should provide visual feedback for users that the interaction has been cancelled.\n{% endcall %}\n\n### Lifecycle props\n\nIf a view is the responder, the following callbacks will be called only for this view (i.e., no bubbling.) These callbacks are *always* bookended by `onResponderGrant` (before) and either `onResponderRelease` or `onResponderTerminate` (after).\n\n{% call macro.prop('onResponderStart', '?(event: ResponderEvent) => void') %}\nA pointer down event occured on the screen. The responder is notified of all start events, even if the pointer target is not this view (i.e., additional pointers are being used). Therefore, this callback may be called multiple times while the view is the responder.\n{% endcall %}\n\n{% call macro.prop('onResponderMove', '?(event: ResponderEvent) => void') %}\nA pointer move event occured on the screen. The responder is notified of all move events, even if the pointer target is not this view (i.e., additional pointers are being used). Therefore, this callback may be called multiple times while the view is the responder.\n{% endcall %}\n\n{% call macro.prop('onResponderEnd', '?(event: ResponderEvent) => void') %}\nA pointer up event occured on the screen. The responder is notified of all end events, even if the pointer target is not this view (i.e., additional pointers are being used). Therefore, this callback may be called multiple times while the view is the responder.\n{% endcall %}\n\n{% call macro.prop('onResponderRelease', '?(event: ResponderEvent) => void') %}\nAs soon as there are no more pointers that *started* inside descendants of the responder, this callback is called on the responder and the interaction lock is released. This is the point at which you should provide visual feedback for users that the interaction is over.\n{% endcall %}\n\n### ResponderEvent\n\nEvery callback is called with a `ResponderEvent` event. Data dervied from the native events, e.g., the native `target` and pointer coordinates, can be used to determine the return value of the negotiation callbacks, etc.\n\n{% call macro.prop('currentTarget', 'EventTarget') %}\nThe DOM element acting as the responder view.\n{% endcall %}\n\n{% call macro.prop('defaultPrevented', 'boolean') %}\n{% endcall %}\n\n{% call macro.prop('eventPhase', 'number') %}\n{% endcall %}\n\n{% call macro.prop('isDefaultPrevented', '() => boolean') %}\n{% endcall %}\n\n{% call macro.prop('isPropagationStopped', '() => boolean') %}\n{% endcall %}\n\n{% call macro.prop('isTrusted', 'boolean') %}\n{% endcall %}\n\n{% call macro.prop('nativeEvent', 'TouchEvent') %}\n{% endcall %}\n\n{% call macro.prop('target', 'EventTarget') %}\n{% endcall %}\n\n{% call macro.prop('timeStamp', 'number') %}\n{% endcall %}\n\n{% call macro.prop('touchHistory', 'TouchHistory') %}\nAn object containing information about the history of touches.\n{% endcall %}\n\n#### TouchHistory\n\n{% call macro.prop('indexOfSingleActiveTouch', 'number') %}\n{% endcall %}\n\n{% call macro.prop('mostRecentTimeStamp', 'number') %}\n{% endcall %}\n\n{% call macro.prop('numberActiveTouches', 'number') %}\n{% endcall %}\n\n{% call macro.prop('touchBank', 'TouchBank') %}\n{% endcall %}\n\n#### TouchBank\n\n{% call macro.prop('currentPageX', 'number') %}\n{% endcall %}\n\n{% call macro.prop('currentPageY', 'number') %}\n{% endcall %}\n\n{% call macro.prop('currentTimeStamp', 'number') %}\n{% endcall %}\n\n{% call macro.prop('previousPageX', 'number') %}\n{% endcall %}\n\n{% call macro.prop('previousPageY', 'number') %}\n{% endcall %}\n\n{% call macro.prop('previousTimeStamp', 'number') %}\n{% endcall %}\n\n{% call macro.prop('startPageX', 'number') %}\n{% endcall %}\n\n{% call macro.prop('startPageY', 'number') %}\n{% endcall %}\n\n{% call macro.prop('startTimeStamp', 'number') %}\n{% endcall %}\n\n{% call macro.prop('touchActive', 'number') %}\n{% endcall %}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/concepts/localization.md",
    "content": "---\ntitle: Localization\ndate: Last Modified\npermalink: /docs/localization/index.html\neleventyNavigation:\n  key: Localization\n  parent: Concepts\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nA guide to producing localized layout for different locales.\n:::\n\n{{ site.name }} provides simple mechanisms to automatically flip layouts to match the writing direction of the app or a specific component tree.\n\n\n## Localization styles\n\nThe non-standard [direction-independent style properties and values]({{ '/docs/styling/#non-standard-properties' | url }}) (e.g., `marginStart`) should be used as much as possible. {{ site.name }} will automatically flip the direction of these properties within subtrees based on the writing direction of the ancestor tree.\n\n```jsx\n// \"start\" is \"left\" for LTR and \"right\" for RTL\nconst style = { paddingInlineStart: 10, marginInlineStart: 10 };\nreturn (\n  <View style={style} />\n);\n```\n\n## Localization props\n\nTo automatically flip the layout of a component and its subtree, you can either:\n\n1. Set the `dir` prop to the desired writing direction (e.g., `\"rtl\"`).\n2. Set the `lang` prop to the locale of the content.\n\n```jsx\n<View dir=\"ltr\">...</View>\n<Text lang=\"ar\">...</Text>\n```\n\nBy default, the native writing direction of `Text` and `TextInput` components is set to `\"auto\"`. This uses the browser's built-in writing direction algorithm to detect whether the text should be displayed left-to-right or right-to-left.\n\n## Localization hook\n\nThe `useLocaleContext` API can be used for fine-grained control of layout, e.g., flipping images or transforms.\n\n```jsx\nconst { direction, locale } = useLocaleContext();\n\nconst isRTL = direction === 'rtl';\nconst style = { scaleX: isRTL ? -1 : 1 };\n\n<Image source={'forward.svg'} style={style} />\n<Image source={isRTL ? 'back.svg' : 'forward.svg'} />\n```\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/concepts/rendering.md",
    "content": "---\ntitle: Rendering\ndate: Last Modified\npermalink: /docs/rendering/index.html\neleventyNavigation:\n  key: Rendering\n  parent: Concepts\n---\n\n:::lead\nClient and server rendering with {{ site.name }}.\n:::\n\nReact Native for Web can be used for multi-platform and web-only applications. It can incrementally adopted by existing React Web apps and integrated with existing React Native apps. Preact is also supported.\n\n{{ site.name }} components interoperate with React DOM components. They can be incrementally introduced at any point in an application's component tree. One thing to be aware of is that external CSS applied to *all* tags in a document may interfere with the default rendering of some {{ site.name }} components.\n\n---\n\n## Client API\n\nRender apps using [AppRegistry]({{ '/docs/app-registry' | url }}):\n\n```js\n// index.web.js\n\nimport { AppRegistry } from 'react-native';\nimport App from './src/App';\n\n// register the app\nAppRegistry.registerComponent('App', () => App);\n\nAppRegistry.runApplication('App', {\n  initialProps: {},\n  rootTag: document.getElementById('root')\n});\n```\n\nOr render individual components:\n\n```js\nimport { render } from 'react-native';\nimport Header from './src/Header';\n\nrender(<Header />, document.getElementById('header'))\n```\n\nYou might need to adjust the styles of the HTML document's root elements for your app to fill the viewport.\n\n```html\n<html style=\"height:100%\">\n  <body style=\"height:100%\">\n    <div id=\"root\" style=\"display:flex;height:100%\"></div>\n```\n\n:::callout\n**Warning!** Although components in can be rendered by calling `ReactDOM.render` directly, this will not set the global context React Native provides to components when using the `AppRegistry` API.\n:::\n\n---\n\n## Server API\n\nServer-side rendering to HTML is supported using `AppRegistry`:\n\n```js\nimport App from './src/App';\nimport ReactDOMServer from 'react-dom/server';\nimport { AppRegistry } from 'react-native-web';\n\n// register the app\nAppRegistry.registerComponent('App', () => App);\n\n// prerender the app\nconst { element, getStyleElement } = AppRegistry.getApplication('App', { initialProps });\n// first the element\nconst html = ReactDOMServer.renderToString(element);\n// then the styles (optionally include a nonce if your CSP policy requires it)\nconst css = ReactDOMServer.renderToStaticMarkup(getStyleElement({ nonce }));\n\n// example HTML document string\nconst document = `\n<!DOCTYPE html>\n<html style=\"height:100%\">\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n${css}\n<body style=\"height:100%; overflow-y:hidden\">\n<div id=\"root\" style=\"display:flex; height: 100%\">\n${html}\n</div>\n<script nonce=\"${nonce}\" src=\"${bundlePath}\"></script>\n`\n```\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/concepts/styling.md",
    "content": "---\ntitle: Styling\ndate: Last Modified\npermalink: /docs/styling/index.html\neleventyNavigation:\n  key: Styling\n  parent: Concepts\n  label: \"Change\"\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\n{{ site.name }} relies on authoring styles in JavaScript and produces optimized CSS.\n:::\n\nStyle declarations are authored in JavaScript and applied to elements using the `style` prop. {{ site.name }} includes a very small CSS reset that only removes unwanted User Agent styles beyond the reach of React components. All other styles are scoped to components and implemented as \"utility\" CSS that deduplicates styles and provides reliable rendering.\n\n```jsx\nconst style = { flex: 1, opacity: 0 };\nconst Component = () => <View style={style} />;\n```\n\nStyle performance is improved when styles are defined outside of components using the `StyleSheet` API. This creates opaque references to the styles that cannot be directly accessed unless first passed to `StyleSheet.flatten`.\n\n```jsx\nconst styles = StyleSheet.create({ root: { flex: 1, opacity: 0 } });\nconst Component = () => <View style={styles.root} />;\n```\n\nAll the React Native components accept a `style` property. The value can be a registered object, a plain object, or an array of objects. The array syntax will merge styles from left-to-right as normal JavaScript objects, and can be used to conditionally apply styles:\n\n```jsx\n<View style={[ styles.element, isActive && styles.active ]} />\n```\n\nTo let other components customize the style of a component's children you can expose a prop so styles can be explicitly passed into the component.\n\n```jsx\nfunction List(props) {\n  return (\n    <View style={props.style}>\n      {elements.map((element) =>\n        <View style={[ styles.element, props.elementStyle ]} />\n      )}\n    </View>\n  );\n}\n\nfunction App() {\n  return (\n    <List\n      elementStyle={styles.listElement}\n      style={styles.list}\n    />\n  );\n}\n```\n\nYou have greater control over how styles are composed when compared to using class names. For example, you may choose to accept a limited subset of style props in the component's API, and control the order and conditions of their merging.\n\n---\n\n## Styles API\n\n{{ site.name }} supports all *long-form* CSS properties. There is no direct support for `@`-rules, selectors, pseudo-selectors, and pseudo-elements, equivalents of which are demonstrated in the [styling patterns](#styling-patterns) section below.\n\n### Short-form properties\n\nThe supported short-form CSS properties accept only a *single* value.\n\n{% call macro.prop('borderColor', '?string') %}\nAccepts only a single value that is applied to all sides.\n{% endcall %}\n\n{% call macro.prop('borderRadius', '?(number | string)') %}\nAccepts only a single value that is applied to all sides.\n{% endcall %}\n\n{% call macro.prop('borderStyle', '?string') %}\nAccepts only a single value that is applied to all sides.\n{% endcall %}\n\n{% call macro.prop('borderWidth', '?(number | string)') %}\nAccepts only a single value that is applied to all sides.\n{% endcall %}\n\n{% call macro.prop('flex', '?number') %}\nAccepts only positive integers, `0`, or `-1`.\nThe value of `-1` is non-standard and equivalent to setting `flowGrow:0` and `flexShrink:1`.\n{% endcall %}\n\n{% call macro.prop('inset', '?(string | number)') %}\nEquivalent to [inset](https://developer.mozilla.org/en-US/docs/Web/CSS/inset).\n{% endcall %}\n\n{% call macro.prop('insetBlock', '?(string | number)') %}\nEquivalent to [inset-block](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-block).\n{% endcall %}\n\n{% call macro.prop('insetInline', '?(string | number)') %}\nEquivalent to [inset-inline](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline).\n{% endcall %}\n\n{% call macro.prop('margin', '?(number | string)') %}\nAccepts only a single value that is applied to all sides.\n{% endcall %}\n\n{% call macro.prop('marginBlock', '?(number | string)') %}\nEquivalent to [margin-block](https://developer.mozilla.org/en-US/docs/Web/CSS/margin-block).\n{% endcall %}\n\n{% call macro.prop('marginInline', '?(number | string)') %}\nEquivalent to [margin-inline](https://developer.mozilla.org/en-US/docs/Web/CSS/margin-inline). Accepts only a single value.\n{% endcall %}\n\n{% call macro.prop('overflow', '?(\"auto\" | \"hidden\" | \"visible\")') %}\nAccepts only a single value that is applied to both axes.\n{% endcall %}\n\n{% call macro.prop('overscrollBehavior', '?(\"auto\" | \"contain\" | \"none\")') %}\nAccepts only a single value that is applied to both axes.\n{% endcall %}\n\n{% call macro.prop('padding', '?(number | string)') %}\nAccepts only a single value that is applied to all sides.\n{% endcall %}\n\n{% call macro.prop('paddingBlock', '?(number | string)') %}\nEquivalent to [padding-block](https://developer.mozilla.org/en-US/docs/Web/CSS/padding-block).\n{% endcall %}\n\n{% call macro.prop('paddingInline', '?(number | string)') %}\nEquivalent to [padding-inline](https://developer.mozilla.org/en-US/docs/Web/CSS/padding-inline). Accepts only a single value.\n{% endcall %}\n\n### Non-standard properties\n\n{{ site.name }} includes compatibility with the following non-standard React Native properties and values.\n\n{% call macro.prop('animationKeyframes', '?Object') %}\nA web-only CSS extension for defining keyframes. The value is an object representing a [CSS keyframes definition](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Animations/Using_CSS_animations). For example: `{ '0%': { opacity: 1 } }`.\n{% endcall %}\n\n{% call macro.prop('pointerEvents', '?(\"all\" | \"none\" | \"box-only\" | \"box-none\")') %}\nEquivalent to [CSS pointer-events](https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events) with 2 additional values. A value of `\"box-none\"` preserves pointer events on the element's children; `\"box-only\"` disables pointer events on the element's children.\n{% endcall %}\n\n{% call macro.prop('writingDirection', '?(\"auto\" | \"ltr\" | \"rtl\")') %}\nEquivalent to [direction](https://developer.mozilla.org/en-US/docs/Web/CSS/direction).\n{% endcall %}\n\n---\n\n## Text style inheritance\n\nWeb developers will be used to setting \"global\" font styles that are applied to the entire document, taking advantage of inherited CSS properties.\n\n```css\nhtml {\n  font-family: Arial, sans-serif;\n  font-size: 16px;\n  color: #333;\n}\n```\n\nHowever, this approach is problematic for component-based systems, as the rendering of a component may be affected by text styles unexpectedly inherited from its ancestors. {{ site.name }} adopts the same inheritance restrictions found in React Native: all text nodes **must** be contained by a `Text` component and cannot be rendered directly within a `View`; and text style inheritance is only available within `Text` subtrees.\n\n```jsx\n// BAD\n<View>Some text</View>\n// GOOD\n<View><Text>Some text</Text></View>\n```\n\nThe consequence of this is that default text styles cannot be set on `View` for an entire subtree. Although this may seem limiting, it ensures that different design systems can co-exist on the same page and text styles are always encapsulated. The recommended way to use consistent text styles across your application is to create a custom text component (e.g., `AppText`) that implements those styles and forms the basis of further app-specific text customization.\n\n```jsx\n<View>\n  <AppHeaderText>App header text</AppHeaderText>\n  <AppText>App default text</AppText>\n</View>\n```\n\nThis still allows for text style inheritance within the `Text` subtree.\n\n```jsx\nconst bold = { fontWeight: 'bold' }\nconst red = { color: 'red' }\n\n<Text style={bold}>\n  I am bold\n  <Text style={red}>and red</Text>\n</Text>\n```\n\nThis approach means that components are designed with isolation in mind. You should be able to drop a component anywhere in your application, trusting that as long as the props are the same, it will *look and behave* the same way. Text properties that could inherit from outside of the props would break this isolation.\n\n---\n\n## Styling patterns\n\nThe styling system in React Native is a way of defining the styles your application requires; it does not concern itself with _where_ or _when_ those styles are applied to elements. As a result, there is no dedicted Media Query or pseudo-class API built into the styling system. Instead, the state of the application should be derived from the equivalent JavaScript APIs that have the benefit of not being limited to modifying only styles.\n\n### Responsive layouts\n\nMedia Queries may not be most appropriate for component-based designs, as adapting to the dimensions of a container is often preferred. This can be done with the `onLayout` prop found on all the core components. If you do choose to use Media Queries, using them in JavaScript via the `matchMedia` DOM API has the benefit of allowing you to swap out entire components, not just styles.\n\n### Interaction states\n\nInteractions such as hover, focus, and press should be implemented using events (e.g., `onFocus`). Components like `Pressable` expose interaction state in a ready-to-use form.\n\n### Debugging\n\nReact Dev Tools supports inspecting and editing of React Native styles. It's recommended that you rely more on React Dev Tools and live/hot-reloading rather than inspecting and editing the DOM directly.\n\n---\n\n## How it works\n\nStyle resolution is deterministic and slightly different from CSS. In the following HTML/CSS example, the `.margin` selector is defined last in the CSS and takes precedence over the previous rules, resulting in a margin of `0,0,0,0`.\n\n```html\n<style>\n  .marginTop { margin-top: 10px; }\n  .marginBottom { margin-bottom: 20px; }\n  .margin { margin: 0; }\n</style>\n\n<div class=\"marginTop marginBottom margin\"></div>\n```\n\nBut in {{ site.name }} the most *precise* style property takes precedence, resulting in margins of `10,0,20,0`.\n\n```jsx\nconst style = [\n  { marginTop: 10 },\n  { marginBottom: 20 },\n  { margin: 0 }\n];\n\nconst Box = () => <View style={style} />\n```\n\n{{ site.name }} transforms styles objects into CSS and inline styles. Any styles defined using `StyleSheet.create` will ultimately be rendered using CSS class names. Each rule is broken down into declarations, properties are expanded to their long-form, and the resulting key-value pairs are mapped to unique \"atomic CSS\" class names.\n\nInput:\n\n```jsx\nconst Box = () => <View style={styles.box} />\n\nconst styles = StyleSheet.create({\n  box: {\n    margin: 0\n  }\n});\n```\n\nOutput:\n\n```html\n<style>\n  .r-156q2ks { margin-top: 0px; }\n  .r-61z16t { margin-right: 0px; }\n  .r-p1pxzi { margin-bottom: 0px; }\n  .r-11wrixw { margin-left: 0px; }\n</style>\n\n<div class=\"r-156q2ks r-61z16t r-p1pxzi r-11wrixw\"></div>\n```\n\nThis ensures that CSS order doesn't impact rendering and CSS rules are efficiently deduplicated. Rather than the total CSS growing in proportion to the number of *rules*, it grows in proportion to the number of *unique declarations*. As a result, the DOM style sheet is only written to when new unique declarations are defined and it is usually small enough to be pre-rendered and inlined.\n\nClass names are deterministic, which means that the resulting CSS and HTML is consistent across builds – important for large apps using code-splitting and deploying incremental updates.\n\nAt runtime registered styles are resolved to DOM style props and memoized. Any dynamic styles that contain declarations previously registered as static styles can also be converted to CSS class names. Otherwise, they render as inline styles.\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/getting-started/_.md",
    "content": "---\ntitle: Getting started\ndate: Last Modified\npermalink: false\neleventyNavigation:\n  key: Start\n  title: Getting started\n  order: 0 \n---\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/getting-started/browser-compatibility.md",
    "content": "---\ntitle: Browser compatibility\ndate: Last Modified\npermalink: /docs/browser-compatibility/index.html\neleventyNavigation:\n  key: Browser compatibility\n  parent: Start\n  order: 4\n---\n\n:::lead\nUnderstanding {{ site.name }} browser compatibility.\n:::\n\n{{ site.name }} is designed and tested for recent mobile and desktop browsers, for touch and mouse and keyboard interactions.\n\nThe browsers with known support include:\n\n* Chrome 60+\n* Safari 10.1+ / iOS Safari 10.1+\n* Edge 12+\n* Firefox ESR+\n* Opera\n\nIf specific exports have a different browser support expectation, it will be documented with that export.\n\n---\n\n## JavaScript\n\nYour application may need to polyfill `Promise`, `Object.assign`, `Array.from`, and [`ResizeObserver`](https://github.com/que-etc/resize-observer-polyfill) as necessary for your desired browser support.\n\n---\n\n## CSS\n\nMost CSS properties and values are supported. Vendor prefixes are automatically provided where necessary. For example, if you use the following style:\n\n```js\nconst style = {\n  userSelect: 'none'\n}\n```\n\nThe resulting CSS is:\n\n```css\n.r-userSelect-24jds {\n  -webkit-user-select: none;\n  user-select: none;\n}\n```\n\nCertain CSS properties are not supported across all browsers, but are polyfilled by {{ site.name }}.\n\n(N.B. Safari prior to version 10.1 can suffer from extremely [poor flexbox performance](https://bugs.webkit.org/show_bug.cgi?id=150445). The recommended way to work around this issue (as used on mobile.twitter.com) is to set `display:block` on Views in your element hierarchy that you know don't need flexbox layout.)\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/getting-started/help.md",
    "content": "---\ntitle: Help\ndate: Last Modified\npermalink: /docs/help/index.html\ndescription: \neleventyNavigation:\n  key: Help\n  parent: Start\n  order: 7\n---\n\n:::lead\nQuestions? Looking for help? These are the best places to look first.\n:::\n\n## Discussions\n\n[{{ site.name }} Discussions on GitHub]({{ site.githubUrl }}/discussions) is the place for general questions, discussions, and ideas.\n\n## Issues\n\n[{{ site.name }} Issues on GitHub]({{ site.githubUrl }}/issues) is the place for reporting and resolving issues with {{ site.name }}.\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/getting-started/installation.md",
    "content": "---\ntitle: Installation\ndate: Last Modified\npermalink: /docs/installation/index.html\neleventyNavigation:\n  key: Installation\n  parent: Start\n  order: 1\n---\n\n:::lead\nAn overview of how to install and use {{ site.name }}.\n:::\n\nReact Native for Web can be used for multi-platform and web-only applications. It can be incrementally adopted by existing React Web apps and integrated with existing React Native apps. Preact is also supported.\n\n```shell\nnpm install react-dom {{ site.packageName }}\n```\n\nThe Babel plugin is recommended for build-time optimizations.\n\n```shell\nnpm install --save-dev babel-plugin-react-native-web\n```\n\n---\n\n## Quickstart\n\n### Expo\n\n[Expo](https://expo.dev) is a framework and a platform for universal React applications. [Expo for Web](https://docs.expo.dev/workflow/web/) uses React Native for Web, provides dozens of additional cross-platform APIs, includes web build optimizations, and is compatible with the broader React Native ecosystem. See the Expo docs for more information.\n\n### Create React App\n\n[Create React App](https://github.com/facebook/create-react-app) is a basic way to setup a simple, web-only React app with built-in support for aliasing `react-native-web` to `react-native`. However, it's generally recommended that you use Expo.\n\n```shell\nnpx create-react-app my-app\ncd my-app\nnpm install react-native-web\nnpm start\n```\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/getting-started/introduction.md",
    "content": "---\ntitle: Introduction to React Native for Web\ndate: Last Modified\npermalink: /docs/index.html\neleventyNavigation:\n  key: Introduction\n  parent: Start\n  order: 0\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nReact Native for Web is a compatibility layer between React DOM and React Native. It can be used in new and existing apps, web-only and multi-platform apps.\n:::\n\n{{ site.name }} uses React DOM to accurately render React Native compatible JavaScript code in a web browser. This brings several powerful abstractions to web developers include a simple [styles in JavaScript API]({{ '/docs/styling' | url }}), built-in [layout localization]({{ '/docs/localization' | url }}), and a [high-level gesture system]({{ '/docs/interactions/#responder-props-api' | url}}).\n\n## Modern React\n\n{{ site.name }} is made with modern React APIs including function components and hooks. It builds upon React DOM, making it straight-forward for React DOM apps to incrementally adopt the framework (as was done by Twitter and Flipkart.) The project aims to provide broad compatibility with React alternatives, but will continue to evolve with React as APIs like Concurrent Mode and Server Components are introduced.\n\n## Modern Web\n\n{{ site.name }} makes direct use of native DOM APIs to implement specific features. As the Web platform improves, so does {{ site.name }}. Although certain APIs in the project have remained unchanged since inception, the implementations have become smaller and faster by migrating to new DOM APIs as they became broadly available in browsers.\n\n## Components\n\n{{ site.name }} provides all the core components you'd expect from React Native. You will mostly work with `View`, `Image`, `Text`, `TextInput`, and `ScrollView`. The core components include props for working with interactions, including the advanced gesture [responder system]({{ '/docs/interactions' | url }}). Each component's documentation contains live and editable examples to try out. \n\nReact Native for Web exports many different modules to support a variety of use cases. Your application can use as many or as few of these modules as needed. The babel plugin will help you to only bundle the modules that you are using.\n\n## Styles\n\n{{ site.name }} components use JavaScript to author styles which are converted to native CSS. The design of this styling system avoids *all* the [problems with CSS at scale](https://speakerdeck.com/vjeux/react-css-in-js) and produces highly optimized CSS without the need to learn a domain-specific styling language and without the need for specialized tooling that parses markup to remove unused styles.\n\n## Reliable and tested\n\n{{ site.name }} is thoroughly unit and production tested. Significant changes are first published as canary releases to limit regressions and gather feedback from partners. Pull requests record changes to the compressed file size of each module in the library.\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/getting-started/multi-platform.md",
    "content": "---\ntitle: Multi-platform setup\ndate: Last Modified\npermalink: /docs/multi-platform/index.html\neleventyNavigation:\n  key: Multi-platform setup\n  parent: Start\n  order: 3\n---\n\n:::lead\nHow to integrate React Native for Web into an existing React Native codebase.\n:::\n\nPlease read the [setup]({{ '/docs/setup' | url }}) guide first. If you have an existing React Native application, there are more areas that require attention and customization before most web bundlers can consume the non-standard JavaScript in packages produced by the React Native ecosystem. Additionally, 3rd party React Native packages with web support are listed in the [React Native Directory](https://reactnative.directory/?web=true).\n\nIf you are interested in making a multi-platform app it is *strongly recommended* that you use [Expo](https://expo.dev) (or learn from the source code for the Web integration). Expo includes [web support](https://docs.expo.dev/workflow/web/) and takes care of all the configuration work required.\n\n---\n\n## Web-specific code\n\nMinor platform differences can use the `Platform` module.\n\n```js\nimport { Platform } from 'react-native';\n\nconst styles = StyleSheet.create({\n  height: (Platform.OS === 'web') ? 200 : 100,\n});\n```\n\nMore significant platform differences should use platform-specific files (see the webpack configuration below for resolving `*.web.js` files):\n\nFor example, with the following files in your project:\n\n```shell\nMyComponent.android.js\nMyComponent.ios.js\nMyComponent.web.js\n```\n\nAnd the following import:\n\n```js\nimport MyComponent from './MyComponent';\n```\n\nReact Native will automatically import the correct variant for each specific target platform.\n\n---\n\n## Compiling and Bundling\n\nWhat follows is only an _example_ of a basic way to package a Web app using [webpack](https://webpack.js.org) and [Babel](https://babeljs.io/). ([Metro](https://github.com/facebook/metro) is the React Native bundler with [undocumented web support](https://github.com/necolas/react-native-web/issues/1257#issuecomment-541443684).)\n\nInstall webpack-related dependencies, for example:\n\n```shell\nnpm install --save-dev babel-loader url-loader webpack webpack-cli webpack-dev-server\n```\n\nReact Native's Babel preset rewrites ES modules to CommonJS modules, preventing bundlers from automatically performing \"tree-shaking\" to remove unused modules from your web app build. To help with this, you can install the following Babel plugin:\n\n```shell\nnpm install --save-dev babel-plugin-react-native-web\n```\n\nCreate a `web/webpack.config.js` file:\n\n```js\n// web/webpack.config.js\n\nconst path = require('path');\nconst webpack = require('webpack');\n\nconst appDirectory = path.resolve(__dirname, '../');\n\n// This is needed for webpack to compile JavaScript.\n// Many OSS React Native packages are not compiled to ES5 before being\n// published. If you depend on uncompiled packages they may cause webpack build\n// errors. To fix this webpack can be configured to compile to the necessary\n// `node_module`.\nconst babelLoaderConfiguration = {\n  test: /\\.js$/,\n  // Add every directory that needs to be compiled by Babel during the build.\n  include: [\n    path.resolve(appDirectory, 'index.web.js'),\n    path.resolve(appDirectory, 'src'),\n    path.resolve(appDirectory, 'node_modules/react-native-uncompiled')\n  ],\n  use: {\n    loader: 'babel-loader',\n    options: {\n      cacheDirectory: true,\n      // The '@react-native/babel-preset' preset is recommended to match React Native's packager\n      presets: ['module:@react-native/babel-preset'],\n      // Re-write paths to import only the modules needed by the app\n      plugins: ['react-native-web']\n    }\n  }\n};\n\n// This is needed for webpack to import static images in JavaScript files.\nconst imageLoaderConfiguration = {\n  test: /\\.(gif|jpe?g|png|svg)$/,\n  use: {\n    loader: 'url-loader',\n    options: {\n      name: '[name].[ext]',\n      esModule: false,\n    }\n  }\n};\n\nmodule.exports = {\n  entry: [\n    // load any web API polyfills\n    // path.resolve(appDirectory, 'polyfills-web.js'),\n    // your web-specific entry file\n    path.resolve(appDirectory, 'index.web.js')\n  ],\n\n  // configures where the build ends up\n  output: {\n    filename: 'bundle.web.js',\n    path: path.resolve(appDirectory, 'dist')\n  },\n\n  // ...the rest of your config\n\n  module: {\n    rules: [\n      babelLoaderConfiguration,\n      imageLoaderConfiguration\n    ]\n  },\n\n  resolve: {\n    // This will only alias the exact import \"react-native\"\n    alias: {\n      'react-native$': 'react-native-web'\n    },\n    // If you're working on a multi-platform React Native app, web-specific\n    // module implementations should be written in files using the extension\n    // `.web.js`.\n    extensions: [ '.web.js', '.js' ]\n  }\n}\n```\n\nTo run in development from the root of your application:\n\n```shell\n./node_modules/.bin/webpack-dev-server -d --config ./web/webpack.config.js --inline --hot --colors\n```\n\nTo build for production:\n\n```shell\n./node_modules/.bin/webpack -p --config ./web/webpack.config.js\n```\n\nPlease refer to the Webpack documentation for more information on configuration.\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/getting-started/react-native-compatibility.md",
    "content": "---\ntitle: React Native compatibility\ndate: Last Modified\npermalink: /docs/react-native-compatibility/index.html\neleventyNavigation:\n  key: React Native compatibility\n  parent: Start\n  order: 5\n---\n\n:::lead\nReact Native for Web provides compatibility with the vast majority of React Native's JavaScript API. Features deprecated in React Native should be considered *unsupported* in React Native for Web.\n:::\n\n**Best used with React Native >= 0.68**.\n\nVisit the [React Native Directory](https://reactnative.directory/?web=true) to find React Native packages with known web support.\n\n## Components\n\n| Name                     | Status | Notes |\n| :----------------------- | :----- | :---- |\n| ActivityIndicator        | ✓      |  |\n| Button                   | ✓      |  |\n| CheckBox                 | ✓      |  |\n| FlatList                 | ✓      |  |\n| Image                    | ✓      | Missing multiple sources ([#515](https://github.com/necolas/react-native-web/issues/515)) and HTTP headers ([#1019](https://github.com/necolas/react-native-web/issues/1019)). |\n| ImageBackground          | ✓      |  |\n| KeyboardAvoidingView     | (✓)    | Mock. No equivalent web APIs. |\n| Modal                    | ✓      |  |\n| Picker                   | ✓      |  |\n| Pressable                | ✓      |  |\n| RefreshControl           | ✘      | Not started ([#1027](https://github.com/necolas/react-native-web/issues/1027)). |\n| SafeAreaView             | ✓      |  |\n| ScrollView               | ✓      | Missing momentum scroll events ([#1021](https://github.com/necolas/react-native-web/issues/1021)). |\n| SectionList              | ✓      |  |\n| StatusBar                | (✓)    | Mock. No equivalent web APIs. |\n| Switch                   | ✓      |  |\n| Text                     | ✓      | No `onLongPress` ([#1011](https://github.com/necolas/react-native-web/issues/1011)). |\n| TextInput                | ✓      | Missing rich text features ([#1023](https://github.com/necolas/react-native-web/issues/1023)), and auto-expanding behaviour ([#795](https://github.com/necolas/react-native-web/issues/795)). |\n| Touchable                | ✓      | Includes additional support for mouse and keyboard interactions. |\n| TouchableHighlight       | ✓      |  |\n| TouchableNativeFeedback  | ✘      | Not started ([#1024](https://github.com/necolas/react-native-web/issues/1024)). |\n| TouchableOpacity         | ✓      |  |\n| TouchableWithoutFeedback | ✓      |  |\n| View                     | ✓      |  |\n| VirtualizedList          | ✓      |  |\n| YellowBox                | (✓)    | Mock. No YellowBox functionality. |\n\n## APIs\n\n| Name                     | Status | Notes |\n| :----------------------- | :----- | :---- |\n| AccessibilityInfo        | (✓)    | Mock. No equivalent web APIs. |\n| Alert                    | ✘      | Not started ([#1026](https://github.com/necolas/react-native-web/issues/1026)). |\n| Animated                 | ✓      | Missing `useNativeDriver` support. |\n| Appearance               | ✓      |  |\n| AppRegistry              | ✓      | Includes additional support for server rendering with `getApplication`. |\n| AppState                 | ✓      |  |\n| BackHandler              | (✓)    | Mock. No equivalent web APIs. |\n| Clipboard                | ✓      |  |\n| DeviceInfo               | (✓)    | Limited information. |\n| Dimensions               | ✓      |  |\n| Easing                   | ✓      |  |\n| Geolocation              | ✓      |  |\n| I18nManager              | (✓)    | Mock. See [localization](https://necolas.github.io/react-native-web/docs/localization/) for preferred approach. |\n| InteractionManager       | (✓)    |  |\n| Keyboard                 | (✓)    | Mock. |\n| LayoutAnimation          | (✓)    | Missing translation to web animations. |\n| Linking                  | ✓      |  |\n| NativeEventEmitter       | ✓      |  |\n| NativeMethodsMixin       | ✓      |  |\n| NativeModules            | (✓)    | Mocked. Missing ability to load native modules. |\n| PanResponder             | ✓      |  |\n| PixelRatio               | ✓      |  |\n| Platform                 | ✓      |  |\n| Settings                 | ✘      | No equivalent web APIs. |\n| Share                    | ✓      | Only available over HTTPS. Read about the [Web Share API](https://wicg.github.io/web-share/). |\n| StyleSheet               | ✓      |  |\n| UIManager                | ✓      |  |\n| Vibration                | ✓      |  |\n| useColorScheme           | ✓      |  |\n| useWindowDimensions      | ✓      |  |\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/getting-started/setup.md",
    "content": "---\ntitle: Setup\ndate: Last Modified\npermalink: /docs/setup/index.html\neleventyNavigation:\n  key: Setup\n  parent: Start\n  order: 2\n---\n\n:::lead\nHow to integrate React Native for Web with various development tools.\n:::\n\nFind out about package aliasing, package optimization, using types, and customizing the app's HTML shell.\n\n---\n\n## Package aliasing\n\n### Bundler\n\nConfigure your module bundler to alias the package to `react-native`. For example, modify your [webpack](https://github.com/webpack/webpack) configuration as follows:\n\n```js\n// webpack.config.js\nmodule.exports = {\n  // ...the rest of your config\n\n  resolve: {\n    alias: {\n      'react-native$': 'react-native-web'\n    }\n  }\n}\n```\n\n### Compiler\n\n[Babel](https://babeljs.io/) supports module aliasing using [babel-plugin-module-resolver](https://www.npmjs.com/package/babel-plugin-module-resolver)\n\n```js\n{\n  \"plugins\": [\n    [\"module-resolver\", {\n      \"alias\": {\n        \"^react-native$\": \"react-native-web\"\n      }\n    }]\n  ]\n}\n```\n\n### Jest\n\n[Jest](https://facebook.github.io/jest/) can be configured to understand the aliased module.\n\n```js\n{\n  \"moduleNameMapper\": {\n    \"^react-native$\": \"react-native-web\"\n  }\n}\n```\n\n### Flow\n\n[Flow](https://flow.org) can be configured to understand the aliased module.\n\n```yml\n[options]\n# Alias the package name\nmodule.name_mapper='^react-native$' -> 'react-native-web'\n```\n\n### Node.js\n\nNode.js can alias `react-native` to `react-native-web` using [`module-alias`](https://www.npmjs.com/package/module-alias). This is useful if you want to pre-render the app (e.g., server-side rendering or build-time rendering).\n\n```js\n// Install the `module-alias` package as a dependency first\nconst moduleAlias = require(\"module-alias\");\nmoduleAlias.addAliases({\n  \"react-native\": require.resolve(\"react-native-web\"),\n});\nmoduleAlias();\n```\n\n---\n\n## Package optimization\n\nThe project's Babel plugin (see [Installation]({{ '/docs/installation' | url }})) is recommended for build-time optimizations and to prune modules not used by your application.\n\n```js\n{\n  \"plugins\": ['react-native-web']\n}\n```\n\n---\n\n## Types\n\nFlow can be configured to pull types from React Native for Web's source code.\n\n```yml\n[options]\n# Point flow to the 'module' field by default\nmodule.system.node.main_field=module\nmodule.system.node.main_field=main\n```\n\n---\n\n## Root element\n\nFull-screen React Native apps with a root `<ScrollView>` may require the following styles inlined in the HTML document shell. ([Example](https://codesandbox.io/s/52x1871vjl?file=/public/index.html:352-644).)\n\n```css\n/* These styles make the body full-height */\nhtml, body { height: 100%; }\n/* These styles disable body scrolling if you are using <ScrollView> */\nbody { overflow: hidden; }\n/* These styles make the root element full-height */\n#root { display:flex; height:100%; }\n```\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/getting-started/typescript-support.md",
    "content": "---\ntitle: TypeScript support\ndate: Last Modified\npermalink: /docs/typescript-support/index.html\neleventyNavigation:\n  key: TypeScript support\n  parent: Start\n  order: 6\n---\n\n:::lead\nHow to add TypeScript support to your project.\n:::\n\nThe type definitions for `react-native-web` are available on [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-native-web).\n\n---\n\n## Installation\n\nSimply install the following dependency in your project.\n\n```shell\nnpm install --save-dev @types/react-native-web\n```\n\nThe package comes with the `react-native-web` declaration types, so you can use it normally in your project.\n\n```ts\nimport { AppRegistry } from 'react-native-web';\n```\n\n---\n\n## Using it in React Native projects\n\nTo extend the `react-native` types, you have to supply `react-native-web` as a member of the `types` compiler option in the `tsconfig.json` file.\n\n```json\n{\n  ...\n  \"compilerOptions\": {\n    \"types\": [\"react-native-web\"]\n  }\n}\n```\n\nNow you can use `react-native` components in your project with TS support to `react-native-web` props and styles :tada:\n\n```jsx\nimport { View, ViewStyle } from 'react-native';\n\nconst style: ViewStyle = {\n  position: \"fixed\", // RN style properties are augmented with Web-only options e.g. 'fixed'\n  marginBlock: \"auto\", // All Web CSS style properties are also available to use\n};\n\n<View\n  href=\"https://necolas.github.io/react-native-web/\" // RNW prop\n  style={style}\n/>\n```\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/hooks/_.md",
    "content": "---\ntitle: Hooks\ndate: Last Modified\npermalink: false\neleventyNavigation:\n  key: Hooks\n  title: Hooks\n  order: 40\n---\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/hooks/use-color-scheme.md",
    "content": "---\ntitle: useColorScheme\ndate: Last Modified\npermalink: /docs/use-color-scheme/index.html\neleventyNavigation:\n  key: useColorScheme \n  parent: Hooks\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nRespond to color scheme updates from the `Appearance` module.\n:::\n\nThe return value indicates the current user preferred color scheme. The value may be updated later, either through direct user action (e.g., theme selection in device settings) or on a schedule (e.g., light and dark themes that follow the day/night cycle).\n\n```js\nimport { useColorScheme } from 'react-native';\nconst colorScheme = useColorScheme();\n```\n\n---\n\n## API\n\n### Return value\n\n`useColorScheme` returns the color scheme value.\n\n{% call macro.prop('colorScheme', '\"dark\" | \"light\" | null') %}\nA string representing the color scheme.\n{% endcall %}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/hooks/use-locale-context.md",
    "content": "---\ntitle: useLocaleContext\ndate: Last Modified\npermalink: /docs/use-locale-context/index.html\neleventyNavigation:\n  key: useLocaleContext\n  parent: Hooks\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nRespond to locale and writing direction changes from ancestors.\n:::\n\nThe return value matches the current locale and writing direction of the ancestral tree. The value will be updated for descendants when setting the `dir` or `lang` prop on an element.\n\n```js\nimport { useLocaleContext } from 'react-native';\nconst { direction, locale } = useLocaleContext();\n```\n\n---\n\n## API\n\n### Return value\n\n`useLocaleContext` returns the locale context.\n\n{% call macro.prop('direction', '\"ltr\" | \"rtl\"') %}\nA string representing the writing direction context.\n{% endcall %}\n\n{% call macro.prop('locale', '?string') %}\nThe locale context. Locale is `null` if a new direction context is set without an associated locale.\n{% endcall %}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/docs/hooks/use-window-dimensions.md",
    "content": "---\ntitle: useWindowDimensions\ndate: Last Modified\npermalink: /docs/use-window-dimensions/index.html\neleventyNavigation:\n  key: useWindowDimensions \n  parent: Hooks\n---\n\n{% import \"fragments/macros.html\" as macro with context %}\n\n:::lead\nRespond to window size changes from the `Dimensions` module.\n:::\n\n`useWindowDimensions` automatically updates `width` and `height` values when viewport size changes.\n\n```js\nimport { useWindowDimensions } from 'react-native';\nconst { height, scale, width } = useWindowDimensions();\n```\n\n---\n\n## API\n\n### Return value\n\n`useWindowDimensions` returns the `window` dimension object.\n\n{% call macro.prop('height', 'number') %}\nThe height in pixels of the app viewport.\n{% endcall %}\n\n{% call macro.prop('scale', 'number') %}\nThe pixel ratio of the device your app is running on.\n{% endcall %}\n\n{% call macro.prop('width', 'number') %}\nThe width in pixels of the app viewport.\n{% endcall %}\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/home.md",
    "content": "---\ntitle: React Native for Web\ndate: Last Modified\npermalink: /\nlayout: layouts/home.html\n---\n"
  },
  {
    "path": "packages/react-native-web-docs/src/pages/pages.json",
    "content": "{\n  \"layout\": \"layouts/page.html\"\n}\n"
  },
  {
    "path": "packages/react-native-web-examples/.babelrc",
    "content": "{\n  \"presets\": [\n    \"next/babel\",\n    \"@babel/preset-flow\"\n  ],\n  \"plugins\": [\n    [ \"react-native-web\", { \"commonjs\": true } ]\n  ]\n}\n"
  },
  {
    "path": "packages/react-native-web-examples/LICENSE",
    "content": "MIT License\n\nCopyright (c) Nicolas Gallagher.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "packages/react-native-web-examples/README.md",
    "content": "# React Native for Web examples\n\nNext.js pages and React Native components. Provides interactive examples for the documentation website.\n"
  },
  {
    "path": "packages/react-native-web-examples/next.config.js",
    "content": "const fs = require('fs');\nconst path = require('path');\n\nconst pages = fs\n  .readdirSync(path.resolve(__dirname, 'pages'), { withFileTypes: true })\n  .filter((dirent) => dirent.isDirectory())\n  .map((dirent) => dirent.name);\n\nmodule.exports = {\n  env: { pages },\n  webpack: (config, options) => {\n    config.resolve.alias['react-native'] = 'react-native-web';\n    return config;\n  }\n};\n"
  },
  {
    "path": "packages/react-native-web-examples/package.json",
    "content": "{\n  \"private\": true,\n  \"name\": \"react-native-web-examples\",\n  \"version\": \"0.21.2\",\n  \"scripts\": {\n    \"build\": \"next build\",\n    \"dev\": \"next\",\n    \"start\": \"next start\"\n  },\n  \"dependencies\": {\n    \"babel-plugin-react-native-web\": \"0.21.2\",\n    \"next\": \"^12.2.0\",\n    \"react\": \"^18.0.0\",\n    \"react-dom\": \"^18.0.0\",\n    \"react-native-web\": \"0.21.2\"\n  },\n  \"devDependencies\": {\n    \"@babel/core\": \"^7.18.6\",\n    \"@babel/preset-flow\": \"^7.18.6\"\n  },\n  \"license\": \"MIT\"\n}\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/_document.js",
    "content": "import Document, { Html, Head, Main, NextScript } from 'next/document';\nimport { AppRegistry } from 'react-native';\n\nexport default class MyDocument extends Document {\n  static async getInitialProps(ctx) {\n    const { renderPage } = ctx;\n    AppRegistry.registerComponent('rn', () => Main);\n    const { getStyleElement } = AppRegistry.getApplication('rn');\n    const page = await renderPage();\n    const styles = getStyleElement();\n    return { ...page, styles };\n  }\n\n  render() {\n    return (\n      <Html>\n        <Head />\n        <body>\n          <Main />\n          <NextScript />\n        </body>\n      </Html>\n    );\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/activity-indicator/index.js",
    "content": "import { ActivityIndicator, StyleSheet, View } from 'react-native';\nimport React from 'react';\nimport Example from '../../shared/example';\n\nexport default function ActivityIndicatorPage() {\n  const [animating, setAnimating] = React.useState(true);\n\n  React.useEffect(() => {\n    const interval = setInterval(() => {\n      setAnimating(!animating);\n    }, 2000);\n    return () => {\n      clearInterval(interval);\n    };\n  }, [animating]);\n\n  return (\n    <Example title=\"ActivityIndicator\">\n      <View style={styles.row}>\n        <ActivityIndicator style={styles.item} />\n        <ActivityIndicator\n          animating={false}\n          hidesWhenStopped={false}\n          style={styles.item}\n        />\n        <ActivityIndicator\n          animating={animating}\n          hidesWhenStopped={false}\n          style={styles.item}\n        />\n      </View>\n      <View style={styles.row}>\n        <ActivityIndicator color=\"#1DA1F2\" size=\"small\" style={styles.item} />\n        <ActivityIndicator color=\"#17BF63\" size={20} style={styles.item} />\n      </View>\n      <View style={styles.row}>\n        <ActivityIndicator color=\"#FFAD1F\" size=\"large\" style={styles.item} />\n        <ActivityIndicator color=\"#F45D22\" size={36} style={styles.item} />\n      </View>\n      <View style={styles.row}>\n        <ActivityIndicator color=\"#794BC4\" size={60} style={styles.item} />\n      </View>\n    </Example>\n  );\n}\n\nconst styles = StyleSheet.create({\n  row: {\n    alignItems: 'center',\n    flexDirection: 'row',\n    marginVertical: 20\n  },\n  item: {\n    paddingHorizontal: 10\n  }\n});\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/animated/index.js",
    "content": "import React, { useRef } from 'react';\nimport { Animated, Pressable, StyleSheet, Text, View } from 'react-native';\nimport Example from '../../shared/example';\n\nexport default function AnimatedPage() {\n  const anim = useRef(new Animated.Value(0));\n\n  const animateBox = () => {\n    Animated.timing(anim.current, {\n      toValue: 1,\n      duration: 1000,\n      useNativeDriver: false\n    }).start();\n  };\n\n  const transform = anim.current.interpolate({\n    inputRange: [0, 1],\n    outputRange: ['rotate(0deg)', 'rotate(45deg)']\n  });\n\n  return (\n    <Example title=\"Animated\">\n      <View style={styles.container}>\n        <Animated.View style={[styles.animatedBox, { transform: transform }]} />\n        <Pressable\n          onPress={animateBox}\n          style={({ pressed }) => [\n            styles.button,\n            { opacity: pressed ? 0.4 : 1 }\n          ]}\n        >\n          <Text style={styles.buttonText}>Animate Box</Text>\n        </Pressable>\n      </View>\n    </Example>\n  );\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center'\n  },\n  animatedBox: {\n    width: 100,\n    height: 100,\n    backgroundColor: 'red',\n    alignSelf: 'center'\n  },\n  button: {\n    padding: 16,\n    paddingVertical: 8,\n    backgroundColor: 'blue',\n    borderRadius: 8,\n    marginTop: 24\n  },\n  buttonText: { color: 'white' }\n});\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/app-registry/index.js",
    "content": "import React from 'react';\nimport { AppRegistry, Text, StyleSheet } from 'react-native';\nimport Example from '../../shared/example';\n\nfunction App() {\n  return <Text style={styles.text}>Should be red and bold</Text>;\n}\n\nconst styles = StyleSheet.create({\n  text: {\n    color: 'red',\n    fontWeight: 'bold'\n  }\n});\n\nAppRegistry.registerComponent('App', () => App);\n\nexport default function AppStatePage() {\n  const iframeRef = React.useRef(null);\n  const shadowRef = React.useRef(null);\n\n  React.useEffect(() => {\n    const iframeElement = iframeRef.current;\n    const iframeBody = iframeElement.contentWindow.document.body;\n    const iframeRootTag = document.createElement('div');\n    iframeRootTag.id = 'iframe-root';\n    iframeBody.appendChild(iframeRootTag);\n    const app1 = AppRegistry.runApplication('App', { rootTag: iframeRootTag });\n\n    const shadowElement = shadowRef.current;\n    const shadowRoot = shadowElement.attachShadow({ mode: 'open' });\n    const shadowRootTag = document.createElement('div');\n    shadowRootTag.id = 'shadow-root';\n    shadowRoot.appendChild(shadowRootTag);\n    const app2 = AppRegistry.runApplication('App', { rootTag: shadowRootTag });\n\n    return () => {\n      app1.unmount();\n      app2.unmount();\n    };\n  }, []);\n\n  return (\n    <Example title=\"AppRegistry\">\n      <Text>Styles in iframe</Text>\n      <iframe ref={iframeRef} />\n      <Text>Styles in ShadowRoot</Text>\n      <div ref={shadowRef} />\n    </Example>\n  );\n}\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/app-state/index.js",
    "content": "import React from 'react';\nimport { AppState, Text } from 'react-native';\nimport Example from '../../shared/example';\n\nexport default function AppStatePage() {\n  const appState = React.useRef(AppState.currentState);\n  const [state, setState] = React.useState({\n    active: 0,\n    background: 0,\n    currentState: appState.current\n  });\n\n  React.useEffect(() => {\n    const handleChange = (nextState) => {\n      setState((previousState) => ({\n        ...previousState,\n        [nextState]: previousState[nextState] + 1\n      }));\n    };\n\n    const subscription = AppState.addEventListener('change', handleChange);\n    return () => {\n      subscription.remove();\n    };\n  }, []);\n\n  return (\n    <Example title=\"AppState\">\n      <Text style={{ marginTop: '1rem' }}>\n        AppState.currentState:{' '}\n        <Text style={{ fontWeight: 'bold' }}>{state.currentState}</Text>\n      </Text>\n      <Text>Active count: {state.active}</Text>\n      <Text>Background count: {state.background}</Text>\n    </Example>\n  );\n}\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/checkbox/index.js",
    "content": "import { CheckBox, StyleSheet, View } from 'react-native';\nimport React from 'react';\nimport Example from '../../shared/example';\n\nfunction Divider() {\n  return <View style={styles.divider} />;\n}\n\nexport default function CheckboxPage() {\n  const [checked, setChecked] = React.useState(true);\n\n  React.useEffect(() => {\n    const interval = setInterval(() => {\n      setChecked(!checked);\n    }, 2500);\n    return () => {\n      clearInterval(interval);\n    };\n  }, [checked]);\n\n  return (\n    <Example title=\"CheckBox\">\n      <View style={styles.row}>\n        <CheckBox disabled style={styles.item} value={false} />\n        <Divider />\n        <CheckBox disabled style={styles.item} value={true} />\n        <Divider />\n        <CheckBox aria-readonly style={styles.item} value={true} />\n      </View>\n      <View style={styles.row}>\n        <CheckBox value={false} />\n        <Divider />\n        <CheckBox value={true} />\n      </View>\n      <View style={styles.row}>\n        <CheckBox color=\"#1DA1F2\" value={true} />\n        <Divider />\n        <CheckBox color=\"#17BF63\" value={true} />\n        <Divider />\n        <CheckBox color=\"#FFAD1F\" value={true} />\n        <Divider />\n        <CheckBox color=\"#F45D22\" value={true} />\n        <Divider />\n        <CheckBox color=\"#794BC4\" value={true} />\n        <Divider />\n        <CheckBox color=\"#E0245E\" value={true} />\n      </View>\n      <View style={styles.row}>\n        <CheckBox\n          color=\"#1DA1F2\"\n          style={{ height: 32, width: 32 }}\n          value={checked}\n        />\n      </View>\n    </Example>\n  );\n}\n\nconst styles = StyleSheet.create({\n  row: {\n    alignItems: 'center',\n    flexDirection: 'row',\n    marginVertical: 20\n  },\n  divider: {\n    width: 10\n  }\n});\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/clipboard/index.js",
    "content": "import { Clipboard, StyleSheet, TextInput, View } from 'react-native';\nimport React from 'react';\nimport Button from '../../shared/button';\nimport Example from '../../shared/example';\n\nexport default function ClipboardPage() {\n  const setString = () => {\n    const success = Clipboard.setString(\n      'This text was copied to the clipboard by React Native'\n    );\n    console.log(`Clipboard.setString success? ${success}`);\n  };\n\n  return (\n    <Example title=\"Clipboard\">\n      <View style={styles.buttonBox}>\n        <Button onPress={setString} title=\"Copy to clipboard\" />\n      </View>\n      <TextInput\n        multiline={true}\n        placeholder={'Try pasting here afterwards'}\n        style={styles.textInput}\n      />\n    </Example>\n  );\n}\n\nconst styles = StyleSheet.create({\n  buttonBox: {\n    maxWidth: 300,\n    marginTop: '1rem'\n  },\n  textInput: {\n    borderColor: '#AAB8C2',\n    borderWidth: 1,\n    height: 50,\n    marginTop: 20,\n    padding: 5\n  }\n});\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/dimensions/index.js",
    "content": "import React from 'react';\nimport { Dimensions, Text } from 'react-native';\nimport Example from '../../shared/example';\n\nexport default function DimensionsPage() {\n  const [screenDims, setScreen] = React.useState(Dimensions.get('screen'));\n  const [windowDims, setWindow] = React.useState(Dimensions.get('window'));\n\n  React.useEffect(() => {\n    const handleChange = ({ screen, window: win }) => {\n      setScreen(screen);\n      setWindow(win);\n    };\n\n    const subscription = Dimensions.addEventListener('change', handleChange);\n    return () => {\n      subscription.remove();\n    };\n  }, [setScreen, setWindow]);\n\n  return (\n    <Example title=\"Dimensions\">\n      <Text style={{ marginVertical: '1em' }} suppressHydrationWarnings={true}>\n        window: {JSON.stringify(windowDims, null, 2)}\n      </Text>\n      <Text suppressHydrationWarnings={true}>\n        screen: {JSON.stringify(screenDims, null, 2)}\n      </Text>\n    </Example>\n  );\n}\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/flatlist/index.js",
    "content": "import React from 'react';\nimport { StyleSheet } from 'react-native';\nimport Example from '../../shared/example';\nimport { FlatList, Text, Pressable, View } from 'react-native-web';\n\nconst multiSelectData = ['First', 'Second', 'Third'].map((title, id) => ({\n  id,\n  title\n}));\nconst minimalData = ['a', 'b', 'c', 'd', 'e'].map((key) => ({ key }));\nconst pageExamplesData = ['minimal', 'multiSelect'].map((type) => ({ type }));\n\nclass MyListItem extends React.PureComponent {\n  _onPress = () => {\n    this.props.onPressItem(this.props.id);\n  };\n\n  render() {\n    const textColor = this.props.selected ? 'red' : 'black';\n    return (\n      <Pressable onPress={this._onPress}>\n        <View>\n          <Text style={[styles.listItemText, { color: textColor }]}>\n            {this.props.title}\n          </Text>\n        </View>\n      </Pressable>\n    );\n  }\n}\n\nclass MultiSelectList extends React.PureComponent {\n  state = { selected: new Map() };\n\n  _keyExtractor = (item, index) => item.id;\n\n  _onPressItem = (id) => {\n    // updater functions are preferred for transactional updates\n    this.setState((state) => {\n      // copy the map rather than modifying state.\n      const selected = new Map(state.selected);\n      selected.set(id, !selected.get(id)); // toggle\n      return { selected };\n    });\n  };\n\n  _renderItem = ({ item }) => (\n    <MyListItem\n      id={item.id}\n      onPressItem={this._onPressItem}\n      selected={!!this.state.selected.get(item.id)}\n      title={item.title}\n    />\n  );\n\n  render() {\n    return (\n      <FlatList\n        data={multiSelectData}\n        extraData={this.state}\n        keyExtractor={this._keyExtractor}\n        renderItem={this._renderItem}\n      />\n    );\n  }\n}\n\nfunction renderExampleItem({ item }) {\n  switch (item.type) {\n    case 'minimal':\n      // Example Minimal FlatList, directly from FlatList's own JSDoc details.\n      // Appending our own view as a header to keep this example itself tightly matching the JSDoc.\n      return (\n        <View style={styles.exampleContainer}>\n          <Text style={styles.exampleHeaderText}>Minimal FlatList:</Text>\n          <FlatList\n            data={minimalData}\n            renderItem={({ item }) => (\n              <Text style={styles.listItemText}>{item.key}</Text>\n            )}\n          />\n        </View>\n      );\n    case 'multiSelect':\n      // Example Multi-Select FlatList, directly from FlatList's own JSDoc details.\n      // Appending our own view as a header to keep this example itself tightly matching the JSDoc.\n      return (\n        <View style={styles.exampleContainer}>\n          <Text style={styles.exampleHeaderText}>Multi-Select FlatList:</Text>\n          <MultiSelectList />\n        </View>\n      );\n    default:\n      throw new Error('Unexpected Item Type');\n  }\n}\n\nexport default function FlatListPage() {\n  return (\n    <Example title=\"FlatList\">\n      <FlatList\n        ListFooterComponent={\n          <Text style={styles.allExamplesFooter}>\n            (Example ListFooterComponent Here)\n          </Text>\n        }\n        ListHeaderComponent={\n          <Text style={styles.allExamplesHeader}>\n            (Example ListHeaderComponent Here)\n          </Text>\n        }\n        data={pageExamplesData}\n        renderItem={renderExampleItem}\n      />\n    </Example>\n  );\n}\n\nconst styles = StyleSheet.create({\n  allExamplesFooter: { fontSize: 22 },\n  allExamplesHeader: { fontSize: 22, marginBottom: 20 },\n  exampleContainer: { marginBottom: 20 },\n  exampleHeaderText: { fontSize: 18, fontWeight: 'bold' },\n  listItemText: { fontSize: 16 }\n});\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/image/index.js",
    "content": "import { Image, StyleSheet, Text, View } from 'react-native';\nimport React from 'react';\nimport Example from '../../shared/example';\n\nconst placeholder = '/image/placeholder.svg';\nconst source =\n  'https://images.unsplash.com/photo-1481595357459-84468f6eeaac?dpr=1&auto=format&fit=crop&w=376&h=251&q=60&cs=tinysrgb';\nconst agif =\n  'http://38.media.tumblr.com/9e9bd08c6e2d10561dd1fb4197df4c4e/tumblr_mfqekpMktw1rn90umo1_500.gif';\nconst pjpeg = 'http://pooyak.com/p/progjpeg/jpegload.cgi?o=1';\nconst resizesource = '/image/smallflower.jpg';\nconst dataBase64Png =\n  'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAQAAACSR7JhAAADtUlEQVR4Ac3YA2Bj6QLH0XPT1Fzbtm29tW3btm3bfLZtv7e2ObZnms7d8Uw098tuetPzrxv8wiISrtVudrG2JXQZ4VOv+qUfmqCGGl1mqLhoA52oZlb0mrjsnhKpgeUNEs91Z0pd1kvihA3ULGVHiQO2narKSHKkEMulm9VgUyE60s1aWoMQUbpZOWE+kaqs4eLEjdIlZTcFZB0ndc1+lhB1lZrIuk5P2aib1NBpZaL+JaOGIt0ls47SKzLC7CqrlGF6RZ09HGoNy1lYl2aRSWL5GuzqWU1KafRdoRp0iOQEiDzgZPnG6DbldcomadViflnl/cL93tOoVbsOLVM2jylvdWjXolWX1hmfZbGR/wjypDjFLSZIRov09BgYmtUqPQPlQrPapecLgTIy0jMgPKtTeob2zWtrGH3xvjUkPCtNg/tm1rjwrMa+mdUkPd3hWbH0jArPGiU9ufCsNNWFZ40wpwn+62/66R2RUtoso1OB34tnLOcy7YB1fUdc9e0q3yru8PGM773vXsuZ5YIZX+5xmHwHGVvlrGPN6ZSiP1smOsMMde40wKv2VmwPPVXNut4sVpUreZiLBHi0qln/VQeI/LTMYXpsJtFiclUN+5HVZazim+Ky+7sAvxWnvjXrJFneVtLWLyPJu9K3cXLWeOlbMTlrIelbMDlrLenrjEQOtIF+fuI9xRp9ZBFp6+b6WT8RrxEpdK64BuvHgDk+vUy+b5hYk6zfyfs051gRoNO1usU12WWRWL73/MMEy9pMi9qIrR4ZpV16Rrvduxazmy1FSvuFXRkqTnE7m2kdb5U8xGjLw/spRr1uTov4uOgQE+0N/DvFrG/Jt7i/FzwxbA9kDanhf2w+t4V97G8lrT7wc08aA2QNUkuTfW/KimT01wdlfK4yEw030VfT0RtZbzjeMprNq8m8tnSTASrTLti64oBNdpmMQm0eEwvfPwRbUBywG5TzjPCsdwk3IeAXjQblLCoXnDVeoAz6SfJNk5TTzytCNZk/POtTSV40NwOFWzw86wNJRpubpXsn60NJFlHeqlYRbslqZm2jnEZ3qcSKgm0kTli3zZVS7y/iivZTweYXJ26Y+RTbV1zh3hYkgyFGSTKPfRVbRqWWVReaxYeSLarYv1Qqsmh1s95S7G+eEWK0f3jYKTbV6bOwepjfhtafsvUsqrQvrGC8YhmnO9cSCk3yuY984F1vesdHYhWJ5FvASlacshUsajFt2mUM9pqzvKGcyNJW0arTKN1GGGzQlH0tXwLDgQTurS8eIQAAAABJRU5ErkJggg==';\nconst dataBase64Svg =\n  'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0nMjAwJyBoZWlnaHQ9JzIwMCcgZmlsbD0iIzAwMDAwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDEwMCAxMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxnPjxwYXRoIGQ9Ik0yNS44NjcsNDguODUzQzMyLjgwNiw1MC4xNzYsNDYuNDYsNTIuNSw2MS4yMTUsNTIuNWgwLjAwNWM5LjcxLDAsMTguNDAxLTEuMDU3LDI1LjkzOC0yLjkxMyAgIGMwLjE1OS0wLjA0NiwwLjM1LTAuMTM1LDAuNTY1LTAuMTg3YzAuMjgyLTAuMDcyLDAuNTY1LTAuMTY0LDAuODQ0LTAuMjM4YzMuMTg0LTAuOTY0LDIuNTc3LTMuMDUxLDIuMTk5LTMuODUyICAgYy00LjE2Ni03LjcxOS0xNS4wODYtMjMuNDE1LTM1LjAyOC0yMy40MTVjLTIyLjE2OSwwLTMwLjI2MiwxMC42MzUtMzMuMTQsMTkuNTg5QzIyLjU0NSw0Mi4zMzMsMjIuNDA3LDQ3LjEzNSwyNS44NjcsNDguODUzeiAgICBNMjguNjc2LDM4LjAzMmMwLjAxMy0wLjAzNiwwLjYxNC0xLjYyNiwxLjkyMy0xLjAwOGMxLjEzMywwLjUzNSwwLjk2MSwxLjU2MywwLjg4NywxLjg1Yy0wLjAwNywwLjAyNC0wLjAxNCwwLjA0OC0wLjAyMSwwLjA3MyAgIGMwLDAuMDAxLTAuMDAxLDAuMDA0LTAuMDAxLDAuMDA0bDAsMGMtMC4yNDksMC45MjktMC40MDQsMi4wODYtMC4wMTcsMi44NmMwLjE2LDAuMzE5LDAuNDkyLDAuNzY4LDEuNTQyLDAuOTg3bDAuMzY2LDAuMDc3ICAgYzIwLjgxNiw0LjM2LDM2LDIuOTMzLDQ1LjY3OCwwLjYyNmwtMC4wMDQsMC4wMDJjMCwwLDAuMDA1LTAuMDAyLDAuMDA3LTAuMDAzYzAuMjEyLTAuMDUsMC40MjEtMC4xMDEsMC42MjgtMC4xNTIgICBjMC41MDktMC4wNSwxLjE3MywwLjA3OCwxLjM5OSwxYzAuMzUxLDEuNDI0LTAuOTczLDEuODk1LTEuMjE3LDEuOTY5Yy01LjMyNSwxLjI3OS0xMi4yNjYsMi4zMDYtMjAuODM1LDIuMzA3ICAgYy03LjUwNSwwLTE2LjI1NS0wLjc4Ny0yNi4yNTctMi44ODJsLTAuMzY0LTAuMDc3Yy0yLjEyLTAuNDQyLTMuMTExLTEuNjMzLTMuNTY5LTIuNTU1QzI3Ljk4NSw0MS40MjEsMjguMjgxLDM5LjQxNiwyOC42NzYsMzguMDMyICAgeiI+PC9wYXRoPjxjaXJjbGUgY3g9IjEwLjQ5MyIgY3k9IjIzLjQ1NSIgcj0iMC42MTkiPjwvY2lyY2xlPjxwYXRoIGQ9Ik0yLjA4LDI4LjMwOGMwLjY3Ni0wLjE3OCwwLjk4My0wLjM1MiwxLjE3NC0wLjVDNC42OSwyNi42OSw2LjUsMjcuNDgzLDcuNSwyOC4zNTd2MC4wMDJjMCwwLDEuNzExLDEuMjM1LDAuNzM3LDIuMjAyICAgYy0wLjk3NCwwLjk2NS0yLjMxOSwwLjAwNi0yLjMxOSwwLjAwNmwwLjAzNSwwLjAxNmMtMC4zMjctMC4yMDMtMC42LTAuNTYxLTAuNzgtMC41ODRjLTAuMzcsMC4yNi0wLjg3NiwwLjUtMS40NzYsMC41SDMuNyAgIGMwLDAtMS4zNDUsMC43MDksMC4xNzgsMS42NTJjMC4wMDEsMC4wMDEsMC4wMDIsMC4wNzIsMC4wMDQsMC4wNzNjMy45MzksMi4zNDIsOC4yNzEsNS43MDEsOC4yNzEsOC44OCAgIGMwLDAuNjkxLDAuMiwxNy4wNDIsMTcuNjI2LDI0LjczOWwwLjk2NywwLjQ0MmwtMC4xLDEuMDU5Yy0wLjQyMSw0LjM5LDEuMTQ1LDEwLjE5MSwxMC45OTMsMTIuODg4bDAuMTEzLDAuMDM4ICAgYzAuMDY3LDAuMDIzLDYuNzMyLDIuNDI5LDEwLjkwNywyLjQyOWMxLjU4NCwwLDIuMTU1LTAuMzUyLDIuMjQzLTAuNTYxYzAuMDg1LTAuMjAyLDAuNjEyLTIuMTY0LTYuMzMyLTkuMzg3bDAuMDAyLTAuMTgzICAgYzAsMC0yLjQ3Ny0zLjA3LDEuNTMzLTMuMDdjMC4wMSwwLDAuMDE5LDAsMC4wMjksMGMxLjI4NSwwLDIuNjA4LDAuMjE1LDMuOTgsMC4xODRjNC43NzEtMC4xMTcsOS4zMTYtMC40MjUsMTMuNTA2LTEuMDk2ICAgbDAuNDc0LTAuMDI4bDAuNjY4LDAuMTU4YzkuNjUxLDQuOTQ4LDE2LjczOCw3LjcxNiwxOS43MzgsNy43MTZ2MC4wMDZjMCwwLDAuMTY0LDAuMDExLDAuMjMsMC4wMDQgICBjLTAuMTg5LTAuNzIzLTIuMjMtMi44LTcuMjMtOS4wNzl2MC4wMjFjMCwwLTEuNTEyLTEuNjU4LDAuNzk3LTIuNjUzYzAuMDYzLTAuMDI2LDAuMDA4LDAuMDIzLDAuMDYtMC4wMDEgICBjOC42MzktMy41MDksMTMuNTAxLTguMjA0LDE1LjQxMS0xMS43NzVjMS4xNDUtMi4xMjksMC4yMDYtMi43ODQtMC42NTktMi45NzZjLTAuMzE3LTAuMDM4LTAuNjM0LTAuMDYyLTAuOTEyLTAuMDYyICAgYy0wLjIwNSwwLTAuMzc5LDAuMDEtMC41MjgsMC4wMjdsLTMuMTQzLDEuMjE0QzgzLjczMiw1My45MjYsNzMuMjE4LDU1LjUsNjEuMjIsNTUuNWMtMC4wMDIsMC0wLjAwNSwwLTAuMDA1LDAgICBjLTE1LjEyOCwwLTI5LjEwMS0yLjQzMi0zNi4wODMtMy43NzFsLTAuMTczLTAuMTExbC0wLjE2LTAuMTI2Yy01Ljg1OC0yLjY4MS01LjEzNy0xMC4yMDItNS4xMDMtMTAuNTE5bDAuMDYtMC4zICAgYzAuODk1LTIuODM4LDIuNDY3LTYuMzUyLDUuMjEzLTkuNzE5Yy0xLjgwOC0xLjM2OS00LjU5LTQuMTg4LTQuNDMtOC40OTRjMC4wNDYtMS4yNDQtMC40ODYtMi41MDgtMS40OTgtMy41NTkgICBjLTEuNDk4LTEuNTU1LTMuNzg1LTIuNDQ2LTYuMjc0LTIuNDQ2Yy0xLjc3LDAtMy41NTMsMC40NDItNS4yOTMsMS4zMTRjLTQuMDYxLDIuMDM1LTQuODU1LDQuNzM2LTUuNjkyLDcuNTk2ICAgYy0wLjEzNiwwLjQ2OC0wLjI4NCwwLjkzOS0wLjQzOCwxLjQxYy0wLjAwNiwwLjAxOS0wLjAyMiwwLjAzNS0wLjAyOCwwLjA1NkMwLjgzMywyOC40MjMsMS42OTEsMjguMzksMi4wOCwyOC4zMDh6IE0xMC40OTMsMTkuOTA4ICAgYzEuOTU2LDAsMy41NDgsMS41OTEsMy41NDgsMy41NDdjMCwxLjk1Ny0xLjU5MiwzLjU0OC0zLjU0OCwzLjU0OGMtMS45NTcsMC0zLjU0OC0xLjU5Mi0zLjU0OC0zLjU0OCAgIEM2Ljk0NCwyMS40OTksOC41MzYsMTkuOTA4LDEwLjQ5MywxOS45MDh6Ij48L3BhdGg+PC9nPjwvc3ZnPg==';\nconst dataSvg =\n  'data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 841.9 595.3\"><g fill=\"#61DAFB\"><path d=\"M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z\"/><circle cx=\"420.9\" cy=\"296.5\" r=\"45.7\"/><path d=\"M520.5 78.1z\"/></g></svg>';\n\nfunction Divider() {\n  return <View style={styles.divider} />;\n}\n\nexport default function ImagePage() {\n  return (\n    <Example title=\"Image\">\n      <Divider />\n      <Image defaultSource={placeholder} style={styles.base} />\n      <Divider />\n      <Image\n        defaultSource={placeholder}\n        onError={() => {\n          console.log('error');\n        }}\n        onLoad={() => {\n          console.log('load');\n        }}\n        onLoadEnd={() => {\n          console.log('load-end');\n        }}\n        onLoadStart={() => {\n          console.log('load-start');\n        }}\n        source={source}\n        style={styles.base}\n      />\n      <Divider />\n      <View style={styles.row}>\n        <View style={styles.column}>\n          <Text style={styles.text}>Static image</Text>\n          <Image\n            resizeMode=\"cover\"\n            source={'/image/ladybug.jpg'}\n            style={styles.image}\n          />\n        </View>\n        <View style={styles.column}>\n          <Text style={styles.text}>Progressive JPEG</Text>\n          <Image source={pjpeg} style={styles.image} />\n        </View>\n      </View>\n      <Divider />\n      <View style={styles.row}>\n        <View style={styles.column}>\n          <Text style={styles.text}>Animated GIF</Text>\n          <Image source={agif} style={styles.image} />\n        </View>\n        <View style={styles.column}>\n          <Text style={styles.text}>PNG (base64)</Text>\n          <Image source={dataBase64Png} style={styles.image} />\n        </View>\n      </View>\n      <Divider />\n      <View style={styles.row}>\n        <View style={styles.column}>\n          <Text style={styles.text}>SVG (base64)</Text>\n          <Image source={dataBase64Svg} style={styles.image} />\n        </View>\n        <View style={styles.column}>\n          <Text style={styles.text}>SVG (inline data)</Text>\n          <Image source={dataSvg} style={styles.image} />\n        </View>\n      </View>\n      <Divider />\n      <View style={styles.row}>\n        <View style={styles.column}>\n          <Text style={[styles.text]}>Center</Text>\n          <Image\n            resizeMode=\"center\"\n            source={resizesource}\n            style={styles.resizeMode}\n          />\n        </View>\n        <View style={styles.column}>\n          <Text style={[styles.text]}>Contain</Text>\n          <Image\n            resizeMode=\"contain\"\n            source={resizesource}\n            style={styles.resizeMode}\n          />\n        </View>\n      </View>\n      <Divider />\n      <View style={styles.row}>\n        <View style={styles.column}>\n          <Text style={[styles.text]}>Cover</Text>\n          <Image\n            resizeMode=\"cover\"\n            source={resizesource}\n            style={styles.resizeMode}\n          />\n        </View>\n        <View style={styles.column}>\n          <Text style={[styles.text]}>Stretch</Text>\n          <Image\n            resizeMode=\"stretch\"\n            source={resizesource}\n            style={styles.resizeMode}\n          />\n        </View>\n      </View>\n    </Example>\n  );\n}\n\nconst styles = StyleSheet.create({\n  base: {\n    height: 200,\n    width: 300\n  },\n  divider: {\n    height: '1rem'\n  },\n  row: {\n    flexDirection: 'row',\n    flexWrap: 'wrap',\n    justifyContent: 'space-between'\n  },\n  column: {\n    marginBottom: '1rem',\n    marginHorizontal: '1rem'\n  },\n  text: {\n    marginBottom: '0.5rem',\n    textAlign: 'center'\n  },\n  image: {\n    borderColor: 'black',\n    borderWidth: 0.5,\n    height: 120,\n    width: 120\n  },\n  resizeMode: {\n    borderColor: 'black',\n    borderWidth: 0.5,\n    height: 120,\n    width: 120\n  },\n  leftMargin: {\n    marginLeft: 10\n  }\n});\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/image-background/index.js",
    "content": "import React from 'react';\nimport { ImageBackground, StyleSheet, Text } from 'react-native';\nimport Example from '../../shared/example';\n\nconst source =\n  'https://images.unsplash.com/photo-1481595357459-84468f6eeaac?dpr=1&auto=format&fit=crop&w=376&h=251&q=60&cs=tinysrgb';\n\nexport default function ImageBackgroundPage() {\n  return (\n    <Example title=\"ImageBackground\">\n      <ImageBackground source={source} style={styles.image}>\n        <Text style={styles.text}>Child content</Text>\n      </ImageBackground>\n    </Example>\n  );\n}\n\nconst styles = StyleSheet.create({\n  image: {\n    width: 300,\n    height: 200,\n    justifyContent: 'center',\n    alignItems: 'center',\n    marginTop: '1.5rem'\n  },\n  text: {\n    color: 'white',\n    fontWeight: 'bold',\n    fontSize: 18,\n    position: 'relative',\n    top: 50\n  }\n});\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/index.js",
    "content": "import NextLink from 'next/link';\nimport React from 'react';\nimport { Image, StyleSheet, Text, View } from 'react-native';\n\nconst logoUri =\n  'data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 841.9 595.3\"><g fill=\"#1977f2\"><path d=\"M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z\" /><circle cx=\"420.9\" cy=\"296.5\" r=\"45.7\" /><path d=\"M520.5 78.1z\" /></g></svg>';\n\nfunction Link(props) {\n  return (\n    <NextLink href={props.href}>\n      <Text {...props} role=\"link\" style={[styles.link, props.style]} />\n    </NextLink>\n  );\n}\n\nexport default function IndexPage() {\n  return (\n    <View style={styles.app}>\n      <View style={styles.header}>\n        <Image\n          aria-label=\"React logo\"\n          resizeMode=\"contain\"\n          source={{ uri: logoUri }}\n          style={styles.logo}\n        />\n        <Text style={styles.title}>React Native for Web</Text>\n      </View>\n      <Text style={styles.text}>\n        <Link href=\"https://github.com/necolas/react-native-web\">\n          React Native for Web\n        </Link>{' '}\n        example app built on Next.js\n      </Text>\n\n      <View role=\"list\">\n        {process.env.pages.map((name) => (\n          <View key={name} role=\"listitem\" style={styles.listitem}>\n            <Link href={'/' + name} style={styles.pageLink}>\n              {name}\n            </Link>\n          </View>\n        ))}\n      </View>\n    </View>\n  );\n}\n\nconst styles = StyleSheet.create({\n  app: {\n    marginHorizontal: 'auto',\n    maxWidth: 500,\n    padding: 20\n  },\n  logo: {\n    height: 80\n  },\n  header: {\n    padding: 20\n  },\n  title: {\n    fontWeight: 'bold',\n    fontSize: '1.5rem',\n    marginTop: '1em',\n    textAlign: 'center'\n  },\n  text: {\n    lineHeight: '1.5em',\n    fontSize: '1.125rem',\n    marginVertical: '1em',\n    textAlign: 'center'\n  },\n  link: {\n    color: '#1977f2'\n  },\n  listitem: {\n    marginVertical: '0.5rem'\n  },\n  pageLink: {\n    fontSize: '1.25rem',\n    fontWeight: 'bold',\n    textAlign: 'center'\n  }\n});\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/linking/index.js",
    "content": "import { Linking, StyleSheet, Text } from 'react-native';\nimport React from 'react';\nimport Example from '../../shared/example';\n\nconst url = 'https://mathiasbynens.github.io/rel-noopener/malicious.html';\n\nexport default function LinkingPage(props) {\n  const [, setCount] = React.useState(0);\n\n  React.useEffect(() => {\n    console.log('adding listener');\n    const listener = Linking.addEventListener('onOpen', () => {\n      console.log('onOpen event');\n    });\n    return () => {\n      console.log('removing listener');\n      listener.remove();\n    };\n  });\n\n  function handlePress() {\n    Linking.canOpenURL(url).then((supported) => {\n      setCount((x) => x + 1);\n      const v = Linking.openURL(url);\n      return v;\n    });\n  }\n\n  return (\n    <Example title=\"Linking\">\n      <Text onPress={handlePress} style={styles.text}>\n        Linking.openURL\n      </Text>\n      <Text\n        href=\"https://mathiasbynens.github.io/rel-noopener/malicious.html\"\n        hrefAttrs={{\n          target: '_blank'\n        }}\n        role=\"link\"\n        style={styles.text}\n      >\n        target=\"_blank\"\n      </Text>\n    </Example>\n  );\n}\n\nconst styles = StyleSheet.create({\n  text: {\n    borderRadius: 5,\n    borderStyle: 'solid',\n    borderWidth: 1,\n    marginVertical: 10,\n    padding: 10\n  }\n});\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/lists/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @noflow\n */\n'use strict';\n\nimport * as React from 'react';\nimport {\n  Animated,\n  FlatList,\n  Image,\n  StyleSheet,\n  Switch,\n  Pressable,\n  Text,\n  TextInput,\n  View\n} from 'react-native';\nimport Example from '../../shared/example';\n\ntype Item = {\n  title: string,\n  text: string,\n  key: string,\n  pressed: boolean,\n  noImage?: ?boolean\n};\n\nconst AnimatedFlatList = Animated.createAnimatedComponent(FlatList);\n\nconst HEADER = { height: 30, width: 100 };\nconst SEPARATOR_HEIGHT = StyleSheet.hairlineWidth;\nconst HORIZ_WIDTH = 200;\nconst ITEM_HEIGHT = 72;\nconst VIEWABILITY_CONFIG = {\n  minimumViewTime: 3000,\n  viewAreaCoveragePercentThreshold: 100,\n  waitForInteraction: true\n};\nconst THUMB_URLS = [\n  './lists/like.png',\n  './lists/dislike.png',\n  './lists/call.png',\n  './lists/fist.png',\n  './lists/bandaged.png',\n  './lists/flowers.png',\n  './lists/heart.png',\n  './lists/liking.png',\n  './lists/party.png',\n  './lists/poke.png',\n  './lists/superlike.png',\n  './lists/victory.png'\n];\nconst LOREM_IPSUM =\n  'Lorem ipsum dolor sit amet, ius ad pertinax oportere accommodare, an vix ' +\n  'civibus corrumpit referrentur. Te nam case ludus inciderint, te mea facilisi adipiscing. Sea id ' +\n  'integre luptatum. In tota sale consequuntur nec. Erat ocurreret mei ei. Eu paulo sapientem ' +\n  'vulputate est, vel an accusam intellegam interesset. Nam eu stet pericula reprimique, ea vim illud ' +\n  'modus, putant invidunt reprehendunt ne qui.';\n\nfunction genItemData(count: number, start: number = 0): Array<Item> {\n  const dataBlob = [];\n  for (let ii = start; ii < count + start; ii++) {\n    const itemHash = Math.abs(hashCode('Item ' + ii));\n    dataBlob.push({\n      title: 'Item ' + ii,\n      text: LOREM_IPSUM.substr(0, (itemHash % 301) + 20),\n      key: String(ii),\n      pressed: false\n    });\n  }\n  return dataBlob;\n}\n\nclass ItemComponent extends React.PureComponent<{\n  fixedHeight?: ?boolean,\n  horizontal?: ?boolean,\n  item: Item,\n  onPress: (key: string) => void,\n  onShowUnderlay?: () => void,\n  onHideUnderlay?: () => void\n}> {\n  _onPress = () => {\n    this.props.onPress(this.props.item.key);\n  };\n  render() {\n    const { fixedHeight, horizontal, item } = this.props;\n    const itemHash = Math.abs(hashCode(item.title));\n    const imgSource = THUMB_URLS[itemHash % THUMB_URLS.length];\n    return (\n      <Pressable\n        onPress={this._onPress}\n        onPressIn={this.props.onShowUnderlay}\n        onPressOut={this.props.onHideUnderlay}\n        style={horizontal ? styles.horizItem : styles.item}\n      >\n        <View\n          style={[\n            styles.row,\n            horizontal && { width: HORIZ_WIDTH },\n            fixedHeight && { height: ITEM_HEIGHT }\n          ]}\n        >\n          {!item.noImage && <Image source={imgSource} style={styles.thumb} />}\n          <Text\n            numberOfLines={horizontal || fixedHeight ? 3 : undefined}\n            style={styles.text}\n          >\n            {item.title} - {item.text}\n          </Text>\n        </View>\n      </Pressable>\n    );\n  }\n}\n\nclass FooterComponent extends React.PureComponent<{}> {\n  render() {\n    return (\n      <View style={styles.headerFooterContainer}>\n        <SeparatorComponent />\n        <View style={styles.headerFooter}>\n          <Text>LIST FOOTER</Text>\n        </View>\n      </View>\n    );\n  }\n}\n\nclass HeaderComponent extends React.PureComponent<{}> {\n  render() {\n    return (\n      <View style={styles.headerFooterContainer}>\n        <View style={styles.headerFooter}>\n          <Text>LIST HEADER</Text>\n        </View>\n        <SeparatorComponent />\n      </View>\n    );\n  }\n}\n\nclass SeparatorComponent extends React.PureComponent<{}> {\n  render() {\n    return <View style={styles.separator} />;\n  }\n}\n\nclass ItemSeparatorComponent extends React.PureComponent<{}> {\n  render() {\n    const style = this.props.highlighted\n      ? [\n          styles.itemSeparator,\n          { marginLeft: 0, backgroundColor: 'rgb(217, 217, 217)' }\n        ]\n      : styles.itemSeparator;\n    return <View style={style} />;\n  }\n}\n\nclass Spindicator extends React.PureComponent<{}> {\n  render() {\n    return (\n      <Animated.View\n        style={[\n          styles.spindicator,\n          {\n            rotate: this.props.value.interpolate({\n              inputRange: [0, 5000],\n              outputRange: ['0deg', '360deg'],\n              extrapolate: 'extend'\n            })\n          }\n        ]}\n      />\n    );\n  }\n}\n\nfunction hashCode(str: string): number {\n  let hash = 15;\n  for (let ii = str.length - 1; ii >= 0; ii--) {\n    hash = (hash << 5) - hash + str.charCodeAt(ii);\n  }\n  return hash;\n}\n\nfunction getItemLayout(data: any, index: number, horizontal?: boolean) {\n  const [length, separator, header] = horizontal\n    ? [HORIZ_WIDTH, 0, HEADER.width]\n    : [ITEM_HEIGHT, SEPARATOR_HEIGHT, HEADER.height];\n  return { length, offset: (length + separator) * index + header, index };\n}\n\nfunction pressItem(context: Object, key: string) {\n  const index = Number(key);\n  const pressed = !context.state.data[index].pressed;\n  context.setState((state) => {\n    const newData = [...state.data];\n    newData[index] = {\n      ...state.data[index],\n      pressed,\n      title: 'Item ' + key + (pressed ? ' (pressed)' : '')\n    };\n    return { data: newData };\n  });\n}\n\nfunction renderSmallSwitchOption(context: Object, key: string) {\n  return (\n    <View style={styles.option}>\n      <Text>{key}:</Text>\n      <Switch\n        onValueChange={(value) => context.setState({ [key]: value })}\n        style={styles.smallSwitch}\n        value={context.state[key]}\n      />\n    </View>\n  );\n}\n\nfunction PlainInput(props: Object) {\n  return (\n    <TextInput\n      autoCapitalize=\"none\"\n      autoCorrect={false}\n      clearButtonMode=\"always\"\n      style={styles.searchTextInput}\n      underlineColorAndroid=\"transparent\"\n      {...props}\n    />\n  );\n}\n\nclass SingleColumnExample extends React.PureComponent {\n  static title = '<FlatList>';\n  static description = 'Performant, scrollable list of data.';\n\n  state = {\n    data: genItemData(100),\n    debug: false,\n    horizontal: false,\n    inverted: false,\n    filterText: '',\n    fixedHeight: true,\n    logViewable: false,\n    virtualized: true\n  };\n\n  _onChangeFilterText = (filterText) => {\n    this.setState({ filterText });\n  };\n\n  _onChangeScrollToIndex = (text) => {\n    this._listRef.scrollToIndex({ viewPosition: 0.5, index: Number(text) });\n  };\n\n  _scrollPos = new Animated.Value(0);\n  _scrollSinkX = Animated.event(\n    [{ nativeEvent: { contentOffset: { x: this._scrollPos } } }],\n    {\n      useNativeDriver: true\n    }\n  );\n  _scrollSinkY = Animated.event(\n    [{ nativeEvent: { contentOffset: { y: this._scrollPos } } }],\n    {\n      useNativeDriver: true\n    }\n  );\n\n  componentDidUpdate() {\n    this._listRef.recordInteraction(); // e.g. flipping logViewable switch\n  }\n\n  render() {\n    const filterRegex = new RegExp(String(this.state.filterText), 'i');\n    const filter = (item) =>\n      filterRegex.test(item.text) || filterRegex.test(item.title);\n    const filteredData = this.state.data.filter(filter);\n    return (\n      <View style={styles.container}>\n        <View style={styles.searchRow}>\n          <View style={styles.options}>\n            <PlainInput\n              onChangeText={this._onChangeFilterText}\n              placeholder=\"Search...\"\n              value={this.state.filterText}\n            />\n            <PlainInput\n              onChangeText={this._onChangeScrollToIndex}\n              placeholder=\"scrollToIndex...\"\n            />\n          </View>\n          <View style={styles.options}>\n            {renderSmallSwitchOption(this, 'virtualized')}\n            {renderSmallSwitchOption(this, 'horizontal')}\n            {renderSmallSwitchOption(this, 'fixedHeight')}\n            {renderSmallSwitchOption(this, 'logViewable')}\n            {renderSmallSwitchOption(this, 'inverted')}\n            {renderSmallSwitchOption(this, 'debug')}\n            <Spindicator value={this._scrollPos} />\n          </View>\n        </View>\n        <SeparatorComponent />\n        <AnimatedFlatList\n          ItemSeparatorComponent={ItemSeparatorComponent}\n          ListFooterComponent={FooterComponent}\n          ListHeaderComponent={<HeaderComponent />}\n          contentContainerStyle={styles.list}\n          data={filteredData}\n          debug={this.state.debug}\n          disableVirtualization={!this.state.virtualized}\n          getItemLayout={\n            this.state.fixedHeight ? this._getItemLayout : undefined\n          }\n          horizontal={this.state.horizontal}\n          inverted={this.state.inverted}\n          key={\n            (this.state.horizontal ? 'h' : 'v') +\n            (this.state.fixedHeight ? 'f' : 'd')\n          }\n          keyboardDismissMode=\"on-drag\"\n          keyboardShouldPersistTaps=\"always\"\n          legacyImplementation={false}\n          numColumns={1}\n          onEndReached={this._onEndReached}\n          onRefresh={this._onRefresh}\n          onScroll={\n            this.state.horizontal ? this._scrollSinkX : this._scrollSinkY\n          }\n          onViewableItemsChanged={this._onViewableItemsChanged}\n          ref={this._captureRef}\n          refreshing={false}\n          renderItem={this._renderItemComponent}\n          viewabilityConfig={VIEWABILITY_CONFIG}\n        />\n      </View>\n    );\n  }\n  _captureRef = (ref) => {\n    this._listRef = ref;\n  };\n  _getItemLayout = (data: any, index: number) => {\n    return getItemLayout(data, index, this.state.horizontal);\n  };\n  _onEndReached = () => {\n    if (this.state.data.length >= 1000) {\n      return;\n    }\n    this.setState((state) => ({\n      data: state.data.concat(genItemData(100, state.data.length))\n    }));\n  };\n  _onRefresh = () => console.log('onRefresh: nothing to refresh :P');\n  _renderItemComponent = ({ item, separators }) => {\n    return (\n      <ItemComponent\n        fixedHeight={this.state.fixedHeight}\n        horizontal={this.state.horizontal}\n        item={item}\n        onHideUnderlay={separators.unhighlight}\n        onPress={this._pressItem}\n        onShowUnderlay={separators.highlight}\n      />\n    );\n  };\n  // This is called when items change viewability by scrolling into or out of\n  // the viewable area.\n  _onViewableItemsChanged = (info: {\n    changed: Array<{\n      key: string,\n      isViewable: boolean,\n      item: any,\n      index: ?number,\n      section?: any\n    }>\n  }) => {\n    // Impressions can be logged here\n    if (this.state.logViewable) {\n      console.log(\n        'onViewableItemsChanged: ',\n        info.changed.map((v) => ({ ...v, item: '...' }))\n      );\n    }\n  };\n  _pressItem = (key: string) => {\n    this._listRef.recordInteraction();\n    pressItem(this, key);\n  };\n  _listRef: AnimatedFlatList;\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    backgroundColor: 'rgb(239, 239, 244)',\n    flex: 1\n  },\n  list: {\n    backgroundColor: 'white'\n  },\n  options: {\n    flexDirection: 'row',\n    flexWrap: 'wrap',\n    alignItems: 'center'\n  },\n  searchRow: {\n    padding: 10\n  },\n  headerFooter: {\n    ...HEADER,\n    alignSelf: 'center',\n    alignItems: 'center',\n    justifyContent: 'center'\n  },\n  headerFooterContainer: {\n    backgroundColor: 'rgb(239, 239, 244)'\n  },\n  horizItem: {\n    alignSelf: 'flex-start' // Necessary for touch highlight\n  },\n  item: {\n    flex: 1\n  },\n  itemSeparator: {\n    height: SEPARATOR_HEIGHT,\n    backgroundColor: 'rgb(200, 199, 204)',\n    marginLeft: 60\n  },\n  option: {\n    flexDirection: 'row',\n    padding: 8,\n    paddingLeft: 0,\n    alignItems: 'center'\n  },\n  row: {\n    flexDirection: 'row',\n    padding: 10,\n    backgroundColor: 'white'\n  },\n  searchTextInput: {\n    backgroundColor: 'white',\n    borderColor: '#cccccc',\n    borderRadius: 3,\n    borderWidth: 1,\n    paddingLeft: 8,\n    paddingVertical: 0,\n    height: 26,\n    fontSize: 14,\n    flexGrow: 1\n  },\n  separator: {\n    height: SEPARATOR_HEIGHT,\n    backgroundColor: 'rgb(200, 199, 204)'\n  },\n  smallSwitch: {\n    top: 1,\n    margin: -6,\n    transform: 'scale(0.7)'\n  },\n  stacked: {\n    alignItems: 'center',\n    backgroundColor: 'white',\n    padding: 10\n  },\n  thumb: {\n    width: 50,\n    height: 50,\n    left: -5\n  },\n  spindicator: {\n    marginLeft: 'auto',\n    marginTop: 8,\n    width: 2,\n    height: 16,\n    backgroundColor: 'darkgray'\n  },\n  stackedText: {\n    padding: 4,\n    fontSize: 18\n  },\n  text: {\n    flex: 1\n  }\n});\n\nexport default function ListsPage() {\n  return (\n    <Example title=\"Lists\">\n      <SingleColumnExample />\n    </Example>\n  );\n}\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/localization/index.js",
    "content": "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\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 * @noflow\n */\n\n/* eslint-disable no-use-before-define */\n\nimport React from 'react';\nimport {\n  Image,\n  PixelRatio,\n  Pressable,\n  ScrollView,\n  StyleSheet,\n  Text,\n  Switch,\n  View\n} from 'react-native';\nimport Example from '../../shared/example';\n\nconst SCALE = PixelRatio.get();\nconst IMAGE_DIMENSION = 100 * SCALE;\nconst IMAGE_SIZE = [IMAGE_DIMENSION, IMAGE_DIMENSION];\nconst iconSource =\n  'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0nMjAwJyBoZWlnaHQ9JzIwMCcgZmlsbD0iIzAwMDAwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDEwMCAxMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxnPjxwYXRoIGQ9Ik0yNS44NjcsNDguODUzQzMyLjgwNiw1MC4xNzYsNDYuNDYsNTIuNSw2MS4yMTUsNTIuNWgwLjAwNWM5LjcxLDAsMTguNDAxLTEuMDU3LDI1LjkzOC0yLjkxMyAgIGMwLjE1OS0wLjA0NiwwLjM1LTAuMTM1LDAuNTY1LTAuMTg3YzAuMjgyLTAuMDcyLDAuNTY1LTAuMTY0LDAuODQ0LTAuMjM4YzMuMTg0LTAuOTY0LDIuNTc3LTMuMDUxLDIuMTk5LTMuODUyICAgYy00LjE2Ni03LjcxOS0xNS4wODYtMjMuNDE1LTM1LjAyOC0yMy40MTVjLTIyLjE2OSwwLTMwLjI2MiwxMC42MzUtMzMuMTQsMTkuNTg5QzIyLjU0NSw0Mi4zMzMsMjIuNDA3LDQ3LjEzNSwyNS44NjcsNDguODUzeiAgICBNMjguNjc2LDM4LjAzMmMwLjAxMy0wLjAzNiwwLjYxNC0xLjYyNiwxLjkyMy0xLjAwOGMxLjEzMywwLjUzNSwwLjk2MSwxLjU2MywwLjg4NywxLjg1Yy0wLjAwNywwLjAyNC0wLjAxNCwwLjA0OC0wLjAyMSwwLjA3MyAgIGMwLDAuMDAxLTAuMDAxLDAuMDA0LTAuMDAxLDAuMDA0bDAsMGMtMC4yNDksMC45MjktMC40MDQsMi4wODYtMC4wMTcsMi44NmMwLjE2LDAuMzE5LDAuNDkyLDAuNzY4LDEuNTQyLDAuOTg3bDAuMzY2LDAuMDc3ICAgYzIwLjgxNiw0LjM2LDM2LDIuOTMzLDQ1LjY3OCwwLjYyNmwtMC4wMDQsMC4wMDJjMCwwLDAuMDA1LTAuMDAyLDAuMDA3LTAuMDAzYzAuMjEyLTAuMDUsMC40MjEtMC4xMDEsMC42MjgtMC4xNTIgICBjMC41MDktMC4wNSwxLjE3MywwLjA3OCwxLjM5OSwxYzAuMzUxLDEuNDI0LTAuOTczLDEuODk1LTEuMjE3LDEuOTY5Yy01LjMyNSwxLjI3OS0xMi4yNjYsMi4zMDYtMjAuODM1LDIuMzA3ICAgYy03LjUwNSwwLTE2LjI1NS0wLjc4Ny0yNi4yNTctMi44ODJsLTAuMzY0LTAuMDc3Yy0yLjEyLTAuNDQyLTMuMTExLTEuNjMzLTMuNTY5LTIuNTU1QzI3Ljk4NSw0MS40MjEsMjguMjgxLDM5LjQxNiwyOC42NzYsMzguMDMyICAgeiI+PC9wYXRoPjxjaXJjbGUgY3g9IjEwLjQ5MyIgY3k9IjIzLjQ1NSIgcj0iMC42MTkiPjwvY2lyY2xlPjxwYXRoIGQ9Ik0yLjA4LDI4LjMwOGMwLjY3Ni0wLjE3OCwwLjk4My0wLjM1MiwxLjE3NC0wLjVDNC42OSwyNi42OSw2LjUsMjcuNDgzLDcuNSwyOC4zNTd2MC4wMDJjMCwwLDEuNzExLDEuMjM1LDAuNzM3LDIuMjAyICAgYy0wLjk3NCwwLjk2NS0yLjMxOSwwLjAwNi0yLjMxOSwwLjAwNmwwLjAzNSwwLjAxNmMtMC4zMjctMC4yMDMtMC42LTAuNTYxLTAuNzgtMC41ODRjLTAuMzcsMC4yNi0wLjg3NiwwLjUtMS40NzYsMC41SDMuNyAgIGMwLDAtMS4zNDUsMC43MDksMC4xNzgsMS42NTJjMC4wMDEsMC4wMDEsMC4wMDIsMC4wNzIsMC4wMDQsMC4wNzNjMy45MzksMi4zNDIsOC4yNzEsNS43MDEsOC4yNzEsOC44OCAgIGMwLDAuNjkxLDAuMiwxNy4wNDIsMTcuNjI2LDI0LjczOWwwLjk2NywwLjQ0MmwtMC4xLDEuMDU5Yy0wLjQyMSw0LjM5LDEuMTQ1LDEwLjE5MSwxMC45OTMsMTIuODg4bDAuMTEzLDAuMDM4ICAgYzAuMDY3LDAuMDIzLDYuNzMyLDIuNDI5LDEwLjkwNywyLjQyOWMxLjU4NCwwLDIuMTU1LTAuMzUyLDIuMjQzLTAuNTYxYzAuMDg1LTAuMjAyLDAuNjEyLTIuMTY0LTYuMzMyLTkuMzg3bDAuMDAyLTAuMTgzICAgYzAsMC0yLjQ3Ny0zLjA3LDEuNTMzLTMuMDdjMC4wMSwwLDAuMDE5LDAsMC4wMjksMGMxLjI4NSwwLDIuNjA4LDAuMjE1LDMuOTgsMC4xODRjNC43NzEtMC4xMTcsOS4zMTYtMC40MjUsMTMuNTA2LTEuMDk2ICAgbDAuNDc0LTAuMDI4bDAuNjY4LDAuMTU4YzkuNjUxLDQuOTQ4LDE2LjczOCw3LjcxNiwxOS43MzgsNy43MTZ2MC4wMDZjMCwwLDAuMTY0LDAuMDExLDAuMjMsMC4wMDQgICBjLTAuMTg5LTAuNzIzLTIuMjMtMi44LTcuMjMtOS4wNzl2MC4wMjFjMCwwLTEuNTEyLTEuNjU4LDAuNzk3LTIuNjUzYzAuMDYzLTAuMDI2LDAuMDA4LDAuMDIzLDAuMDYtMC4wMDEgICBjOC42MzktMy41MDksMTMuNTAxLTguMjA0LDE1LjQxMS0xMS43NzVjMS4xNDUtMi4xMjksMC4yMDYtMi43ODQtMC42NTktMi45NzZjLTAuMzE3LTAuMDM4LTAuNjM0LTAuMDYyLTAuOTEyLTAuMDYyICAgYy0wLjIwNSwwLTAuMzc5LDAuMDEtMC41MjgsMC4wMjdsLTMuMTQzLDEuMjE0QzgzLjczMiw1My45MjYsNzMuMjE4LDU1LjUsNjEuMjIsNTUuNWMtMC4wMDIsMC0wLjAwNSwwLTAuMDA1LDAgICBjLTE1LjEyOCwwLTI5LjEwMS0yLjQzMi0zNi4wODMtMy43NzFsLTAuMTczLTAuMTExbC0wLjE2LTAuMTI2Yy01Ljg1OC0yLjY4MS01LjEzNy0xMC4yMDItNS4xMDMtMTAuNTE5bDAuMDYtMC4zICAgYzAuODk1LTIuODM4LDIuNDY3LTYuMzUyLDUuMjEzLTkuNzE5Yy0xLjgwOC0xLjM2OS00LjU5LTQuMTg4LTQuNDMtOC40OTRjMC4wNDYtMS4yNDQtMC40ODYtMi41MDgtMS40OTgtMy41NTkgICBjLTEuNDk4LTEuNTU1LTMuNzg1LTIuNDQ2LTYuMjc0LTIuNDQ2Yy0xLjc3LDAtMy41NTMsMC40NDItNS4yOTMsMS4zMTRjLTQuMDYxLDIuMDM1LTQuODU1LDQuNzM2LTUuNjkyLDcuNTk2ICAgYy0wLjEzNiwwLjQ2OC0wLjI4NCwwLjkzOS0wLjQzOCwxLjQxYy0wLjAwNiwwLjAxOS0wLjAyMiwwLjAzNS0wLjAyOCwwLjA1NkMwLjgzMywyOC40MjMsMS42OTEsMjguMzksMi4wOCwyOC4zMDh6IE0xMC40OTMsMTkuOTA4ICAgYzEuOTU2LDAsMy41NDgsMS41OTEsMy41NDgsMy41NDdjMCwxLjk1Ny0xLjU5MiwzLjU0OC0zLjU0OCwzLjU0OGMtMS45NTcsMC0zLjU0OC0xLjU5Mi0zLjU0OC0zLjU0OCAgIEM2Ljk0NCwyMS40OTksOC41MzYsMTkuOTA4LDEwLjQ5MywxOS45MDh6Ij48L3BhdGg+PC9nPjwvc3ZnPg==';\n\nfunction ListItem(props) {\n  return (\n    <View style={styles.row}>\n      <View style={styles.column1}>\n        <Image source={props.imageSource} style={styles.icon} />\n      </View>\n      <View style={styles.column2}>\n        <View style={styles.textBox}>\n          <Text>Text Text Text</Text>\n        </View>\n      </View>\n      <View style={styles.column3}>\n        <Pressable onPress={() => {}} style={styles.smallButton}>\n          <Text>Button</Text>\n        </Pressable>\n      </View>\n    </View>\n  );\n}\n\nfunction TextAlignmentExample(props) {\n  return (\n    <Block description={props.description} title={props.title}>\n      <View>\n        <Text style={props.style}>Left-to-Right language text alignment.</Text>\n        <Text style={props.style}>\n          {'\\u0645\\u0646 \\u0627\\u0644\\u064A\\u0645\\u064A\\u0646 ' +\n            '\\u0625\\u0644\\u0649 \\u0627\\u0644\\u064A\\u0633\\u0627\\u0631 ' +\n            '\\u0627\\u0644\\u0644\\u063A\\u0629 \\u062F\\u0648\\u0646 ' +\n            '\\u0645\\u062D\\u0627\\u0630\\u0627\\u0629 \\u0627\\u0644\\u0646\\u0635'}\n        </Text>\n        <Text style={props.style}>\n          {'\\u05DE\\u05D9\\u05DE\\u05D9\\u05DF \\u05DC\\u05E9\\u05DE\\u05D0\\u05DC ' +\n            '\\u05D4\\u05E9\\u05E4\\u05D4 \\u05D1\\u05DC\\u05D9 ' +\n            '\\u05D9\\u05D9\\u05E9\\u05D5\\u05E8 \\u05D8\\u05E7\\u05E1\\u05D8'}\n        </Text>\n      </View>\n    </Block>\n  );\n}\n\nfunction withRTLState(Component) {\n  return class extends React.Component {\n    constructor(...args) {\n      super(...args);\n      this.state = {\n        isRTL: false\n      };\n    }\n\n    render() {\n      const isRTL = this.state.isRTL;\n      const setRTL = (isRTL) => this.setState({ isRTL: isRTL });\n      return <Component isRTL={isRTL} setRTL={setRTL} />;\n    }\n  };\n}\n\nconst RTLToggler = ({ isRTL, setRTL }) => {\n  const toggleRTL = () => setRTL(!isRTL);\n  return (\n    <Pressable\n      aria-label=\"Change layout direction\"\n      color=\"gray\"\n      onPress={toggleRTL}\n    >\n      <Text>{isRTL ? 'RTL' : 'LTR'}</Text>\n    </Pressable>\n  );\n};\n\nconst PaddingExample = withRTLState(({ isRTL, setRTL }) => {\n  const color = 'teal';\n\n  return (\n    <Block title={'padding{Start,End}'}>\n      <Text style={styles.bold}>Styles</Text>\n      <Text>paddingStart: 50,</Text>\n      <Text>paddingEnd: 10</Text>\n      <Text />\n      <Text style={styles.bold}>Demo: </Text>\n      <Text>The {color} is padding.</Text>\n      <View\n        dir={isRTL ? 'rtl' : 'ltr'}\n        style={{\n          backgroundColor: color,\n          paddingStart: 50,\n          paddingEnd: 10,\n          borderWidth: 1,\n          borderColor: color\n        }}\n      >\n        <View\n          style={{\n            backgroundColor: 'white',\n            paddingTop: 5,\n            paddingBottom: 5,\n            borderLeftWidth: 1,\n            borderRightWidth: 1,\n            borderColor: 'gray'\n          }}\n        >\n          <RTLToggler isRTL={isRTL} setRTL={setRTL} />\n        </View>\n      </View>\n    </Block>\n  );\n});\n\nconst MarginExample = withRTLState(({ isRTL, setRTL }) => {\n  return (\n    <Block title={'margin{Start,End}'}>\n      <Text style={styles.bold}>Styles</Text>\n      <Text>marginStart: 50,</Text>\n      <Text>marginEnd: 10</Text>\n      <Text />\n      <Text style={styles.bold}>Demo: </Text>\n      <Text>The green is margin.</Text>\n      <View\n        dir={isRTL ? 'rtl' : 'ltr'}\n        style={{\n          backgroundColor: 'green',\n          borderWidth: 1,\n          borderColor: 'green'\n        }}\n      >\n        <View\n          style={{\n            backgroundColor: 'white',\n            paddingTop: 5,\n            paddingBottom: 5,\n            marginStart: 50,\n            marginEnd: 10,\n            borderLeftWidth: 1,\n            borderRightWidth: 1,\n            borderColor: 'gray'\n          }}\n        >\n          <RTLToggler isRTL={isRTL} setRTL={setRTL} />\n        </View>\n      </View>\n    </Block>\n  );\n});\n\nconst PositionExample = withRTLState(({ isRTL, setRTL }) => {\n  return (\n    <Block title={'position: \"start\" | \"end\"'}>\n      <Text style={styles.bold}>Styles</Text>\n      <Text>start: 50</Text>\n      <Text />\n      <Text style={styles.bold}>Demo: </Text>\n      <Text>The orange is position.</Text>\n      <View\n        dir={isRTL ? 'rtl' : 'ltr'}\n        style={{\n          backgroundColor: 'orange',\n          borderWidth: 1,\n          borderColor: 'orange'\n        }}\n      >\n        <View\n          style={{\n            backgroundColor: 'white',\n            start: 50,\n            borderColor: 'gray'\n          }}\n        >\n          <RTLToggler isRTL={isRTL} setRTL={setRTL} />\n        </View>\n      </View>\n      <Text />\n      <Text style={styles.bold}>Styles</Text>\n      <Text>end: 50</Text>\n      <Text />\n      <Text style={styles.bold}>Demo: </Text>\n      <Text>The orange is position.</Text>\n      <View\n        dir={isRTL ? 'rtl' : 'ltr'}\n        style={{\n          backgroundColor: 'orange',\n          borderWidth: 1,\n          borderColor: 'orange'\n        }}\n      >\n        <View\n          style={{\n            backgroundColor: 'white',\n            end: 50,\n            borderColor: 'gray'\n          }}\n        >\n          <RTLToggler isRTL={isRTL} setRTL={setRTL} />\n        </View>\n      </View>\n    </Block>\n  );\n});\n\nconst BorderWidthExample = withRTLState(({ isRTL, setRTL }) => {\n  return (\n    <Block title={'border{Start,End}Width'}>\n      <Text style={styles.bold}>Styles</Text>\n      <Text>borderStartWidth: 10,</Text>\n      <Text>borderEndWidth: 50</Text>\n      <Text />\n      <Text style={styles.bold}>Demo: </Text>\n      <View dir={isRTL ? 'rtl' : 'ltr'}>\n        <View\n          style={{\n            borderStartWidth: 10,\n            borderEndWidth: 50\n          }}\n        >\n          <View>\n            <RTLToggler isRTL={isRTL} setRTL={setRTL} />\n          </View>\n        </View>\n      </View>\n    </Block>\n  );\n});\n\nconst BorderColorExample = withRTLState(({ isRTL, setRTL }) => {\n  return (\n    <Block title={'border{Start,End}Color'}>\n      <Text style={styles.bold}>Styles</Text>\n      <Text>borderStartColor: 'red',</Text>\n      <Text>borderEndColor: 'green',</Text>\n      <Text />\n      <Text style={styles.bold}>Demo: </Text>\n      <View dir={isRTL ? 'rtl' : 'ltr'}>\n        <View\n          style={{\n            borderStartColor: 'red',\n            borderEndColor: 'green',\n            borderLeftWidth: 20,\n            borderRightWidth: 20,\n            padding: 10\n          }}\n        >\n          <View>\n            <RTLToggler isRTL={isRTL} setRTL={setRTL} />\n          </View>\n        </View>\n      </View>\n    </Block>\n  );\n});\n\nconst BorderRadiiExample = withRTLState(({ isRTL, setRTL }) => {\n  return (\n    <Block title={'border{Top,Bottom}{Start,End}Radius'}>\n      <Text style={styles.bold}>Styles</Text>\n      <Text>borderTopStartRadius: 10,</Text>\n      <Text>borderTopEndRadius: 20,</Text>\n      <Text>borderBottomStartRadius: 30,</Text>\n      <Text>borderBottomEndRadius: 40</Text>\n      <Text />\n      <Text style={styles.bold}>Demo: </Text>\n      <View dir={isRTL ? 'rtl' : 'ltr'}>\n        <View\n          style={{\n            borderWidth: 10,\n            borderTopStartRadius: 10,\n            borderTopEndRadius: 20,\n            borderBottomStartRadius: 30,\n            borderBottomEndRadius: 40,\n            padding: 10\n          }}\n        >\n          <View>\n            <RTLToggler isRTL={isRTL} setRTL={setRTL} />\n          </View>\n        </View>\n      </View>\n    </Block>\n  );\n});\n\nfunction Block(props) {\n  let description;\n  if (props.description) {\n    description = (\n      <Text style={blockStyles.descriptionText}>{props.description}</Text>\n    );\n  }\n\n  return (\n    <View style={blockStyles.container}>\n      <View style={blockStyles.titleContainer}>\n        <Text style={blockStyles.titleText}>{props.title}</Text>\n        {description}\n      </View>\n      <View style={blockStyles.children}>{props.children}</View>\n    </View>\n  );\n}\n\nconst blockStyles = StyleSheet.create({\n  container: {\n    borderRadius: 3,\n    borderWidth: 0.5,\n    borderColor: '#d6d7da',\n    backgroundColor: '#ffffff',\n    margin: 10,\n    marginVertical: 5,\n    overflow: 'hidden'\n  },\n  titleContainer: {\n    borderBottomWidth: 0.5,\n    borderTopLeftRadius: 3,\n    borderTopRightRadius: 2.5,\n    borderBottomColor: '#d6d7da',\n    backgroundColor: '#f6f7f8',\n    paddingHorizontal: 10,\n    paddingVertical: 10\n  },\n  titleText: {\n    fontSize: 16,\n    fontWeight: '500'\n  },\n  descriptionText: {\n    fontSize: 14\n  },\n  disclosure: {\n    position: 'absolute',\n    top: 0,\n    right: 0,\n    padding: 10\n  },\n  disclosureIcon: {\n    width: 12,\n    height: 8\n  },\n  children: {\n    margin: 10\n  }\n});\n\nclass LayoutRTLExample extends React.Component {\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      toggleStatus: {},\n      isRTL: false,\n      containerWidth: 0\n    };\n\n    this._onDirectionChange = this._onDirectionChange.bind(this);\n  }\n\n  render() {\n    return (\n      <ScrollView\n        dir={this.state.isRTL ? 'rtl' : 'ltr'}\n        style={[styles.container]}\n      >\n        <Block title={'Current layout direction'}>\n          <View dir=\"ltr\" style={styles.directionBox}>\n            <Text style={styles.directionText}>\n              {this.state.isRTL ? 'Right-to-Left' : 'Left-to-Right'}\n            </Text>\n            <Switch\n              onValueChange={this._onDirectionChange}\n              value={this.state.isRTL}\n            />\n          </View>\n        </Block>\n\n        <TextAlignmentExample\n          description={'Depends on the text content.'}\n          style={styles.fontSizeSmall}\n          title={'Default text alignment'}\n        />\n        <TextAlignmentExample\n          style={[styles.fontSizeSmall, styles.textAlignLeft]}\n          title={'textAlign: \"left\"'}\n        />\n        <TextAlignmentExample\n          style={[styles.fontSizeSmall, styles.textAlignRight]}\n          title={'textAlign: \"right\"'}\n        />\n        <TextAlignmentExample\n          style={[styles.fontSizeSmall, styles.textAlignStart]}\n          title={'textAlign: \"start\"'}\n        />\n        <TextAlignmentExample\n          style={[styles.fontSizeSmall, styles.textAlignEnd]}\n          title={'textAlign: \"end\"'}\n        />\n        <PaddingExample />\n        <MarginExample />\n        <PositionExample />\n        <BorderColorExample />\n        <BorderWidthExample />\n        <BorderRadiiExample />\n\n        <Block title={'A simple list-item layout'}>\n          <View style={styles.list}>\n            <ListItem\n              imageSource={{ uri: 'https://picsum.photos/130/130?image=222' }}\n            />\n            <ListItem\n              imageSource={{ uri: 'https://picsum.photos/130/130?image=250' }}\n            />\n          </View>\n        </Block>\n\n        <Block title={'Working with icons'}>\n          <View\n            style={[\n              styles.flexDirectionRow,\n              { justifyContent: 'space-around' }\n            ]}\n          >\n            <View style={{ alignItems: 'center' }}>\n              <Image source={iconSource} style={styles.image} />\n              <Text style={styles.fontSizeSmall}>No RTL flip</Text>\n            </View>\n            <View style={{ alignItems: 'center' }}>\n              <Image\n                source={iconSource}\n                style={[\n                  styles.image,\n                  { transform: `scaleX(${this.state.isRTL ? -1 : 1})` }\n                ]}\n              />\n              <Text style={styles.fontSizeSmall}>RTL flip</Text>\n            </View>\n          </View>\n        </Block>\n      </ScrollView>\n    );\n  }\n\n  _onDirectionChange() {\n    this.setState({ isRTL: !this.state.isRTL });\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    width: '100%'\n  },\n  directionBox: {\n    alignItems: 'center',\n    flex: 1,\n    flexDirection: 'row',\n    backgroundColor: '#f8f8f8',\n    borderWidth: 0.5,\n    borderColor: 'black'\n  },\n  directionText: {\n    padding: 10,\n    fontSize: 16,\n    textAlign: 'center',\n    fontWeight: 'bold'\n  },\n  switchRow: {\n    alignItems: 'center',\n    justifyContent: 'space-between',\n    paddingVertical: 5\n  },\n  list: {\n    height: 120,\n    marginBottom: 5,\n    borderTopWidth: 0.5,\n    borderLeftWidth: 0.5,\n    borderRightWidth: 0.5,\n    borderColor: '#e5e5e5'\n  },\n  row: {\n    height: 60,\n    flexDirection: 'row',\n    borderBottomWidth: 0.5,\n    borderColor: '#e5e5e5'\n  },\n  column1: {\n    width: 60,\n    padding: 6\n  },\n  column2: {\n    flex: 1,\n    padding: 6\n  },\n  column3: {\n    justifyContent: 'center',\n    padding: 6\n  },\n  icon: {\n    width: 48,\n    height: 48,\n    borderWidth: 0.5,\n    borderColor: '#e5e5e5'\n  },\n  image: {\n    width: 48,\n    height: 48\n  },\n  img: {\n    width: IMAGE_SIZE[0] / SCALE,\n    height: IMAGE_SIZE[1] / SCALE\n  },\n  view: {\n    flex: 1\n  },\n  block: {\n    padding: 10,\n    alignItems: 'center'\n  },\n  smallButton: {\n    height: 24,\n    width: 64\n  },\n  fontSizeSmall: {\n    fontSize: 14\n  },\n  fontSizeExtraSmall: {\n    fontSize: 12\n  },\n  textAlignLeft: {\n    textAlign: 'left'\n  },\n  textAlignRight: {\n    textAlign: 'right'\n  },\n  textAlignStart: {\n    textAlign: 'start'\n  },\n  textAlignEnd: {\n    textAlign: 'end'\n  },\n  flexDirectionRow: {\n    flexDirection: 'row'\n  },\n  bold: {\n    fontWeight: 'bold'\n  },\n  rtlToggler: {\n    color: 'gray',\n    padding: 8,\n    textAlign: 'center',\n    fontWeight: '500'\n  }\n});\n\nexport default function LocalizationPage() {\n  return (\n    <Example title=\"Localized layout\">\n      <LayoutRTLExample />\n    </Example>\n  );\n}\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/modal/index.js",
    "content": "import React, { useState, useMemo } from 'react';\nimport { Modal, View, Text, StyleSheet } from 'react-native';\nimport Button from '../../shared/button';\nimport Example from '../../shared/example';\n\nfunction Gap() {\n  return <View style={styles.gap} />;\n}\n\nfunction AnimatedModal({ animationType }) {\n  const [isVisible, setIsVisible] = useState(false);\n\n  return (\n    <>\n      <Button\n        onPress={() => setIsVisible(true)}\n        title={`Animation '${animationType}'`}\n      />\n      <Modal\n        animationType={animationType}\n        onRequestClose={() => setIsVisible(false)}\n        visible={isVisible}\n      >\n        <View style={styles.container}>\n          <Text>Modal with \"animationType\" of \"{animationType}\"</Text>\n          <Gap />\n          <Button onPress={() => setIsVisible(false)} title={'Close Modal'} />\n        </View>\n      </Modal>\n    </>\n  );\n}\n\nfunction AnimatedModalStack() {\n  return (\n    <>\n      <AnimatedModal animationType={'none'} />\n      <Gap />\n      <AnimatedModal animationType={'slide'} />\n      <Gap />\n      <AnimatedModal animationType={'fade'} />\n    </>\n  );\n}\n\nconst WIGGLE_ROOM = 128;\n\nfunction Modalception({ depth = 1 }) {\n  const [isVisible, setIsVisible] = useState(false);\n\n  const offset = useMemo(() => {\n    return {\n      top: Math.random() * WIGGLE_ROOM - WIGGLE_ROOM / 2,\n      left: Math.random() * WIGGLE_ROOM - WIGGLE_ROOM / 2\n    };\n  }, []);\n\n  return (\n    <>\n      <Button onPress={() => setIsVisible(true)} title={'Open modal'} />\n      <Modal\n        onRequestClose={() => setIsVisible(false)}\n        transparent\n        visible={isVisible}\n      >\n        <View style={[styles.containeralt, offset]}>\n          <Text>This is in Modal {depth}</Text>\n          <Gap />\n          {isVisible ? <Modalception depth={depth + 1} /> : null}\n          <Gap />\n          <Button\n            color=\"red\"\n            onPress={() => setIsVisible(false)}\n            title={'Close'}\n          />\n        </View>\n      </Modal>\n    </>\n  );\n}\n\nfunction SimpleModal() {\n  const [isVisible, setIsVisible] = useState(false);\n\n  return (\n    <>\n      <Button onPress={() => setIsVisible(true)} title={'Simple modal'} />\n      <Modal onRequestClose={() => setIsVisible(false)} visible={isVisible}>\n        <View style={styles.container}>\n          <Text>Hello, World!</Text>\n          <Gap />\n          <Button onPress={() => setIsVisible(false)} title={'Close'} />\n        </View>\n      </Modal>\n    </>\n  );\n}\n\nfunction TransparentModal() {\n  const [isVisible, setIsVisible] = useState(false);\n\n  return (\n    <>\n      <Button onPress={() => setIsVisible(true)} title={'Transparent modal'} />\n      <Modal\n        onRequestClose={() => setIsVisible(false)}\n        transparent\n        visible={isVisible}\n      >\n        <View style={styles.containeralt}>\n          <Text style={{ textAlign: 'center' }}>\n            Modal with \"transparent\" value\n          </Text>\n          <Gap />\n          <Button onPress={() => setIsVisible(false)} title={'Close'} />\n        </View>\n      </Modal>\n    </>\n  );\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    alignItems: 'center',\n    flex: 1,\n    justifyContent: 'center'\n  },\n  containeralt: {\n    alignItems: 'center',\n    backgroundColor: 'white',\n    borderColor: '#eee',\n    borderRadius: 10,\n    borderWidth: 1,\n    justifyContent: 'center',\n    height: 300,\n    margin: 'auto',\n    padding: 30,\n    width: 300\n  },\n  gap: {\n    height: 10\n  }\n});\n\nexport default function ModalPage() {\n  return (\n    <Example title=\"Modal\">\n      <Gap />\n      <SimpleModal />\n      <Gap />\n      <TransparentModal />\n      <Gap />\n      <AnimatedModalStack />\n      <Gap />\n      <Modalception />\n    </Example>\n  );\n}\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/pan-responder/index.js",
    "content": "/**\n * @flow\n */\nimport React from 'react';\nimport { PanResponder, StyleSheet, View } from 'react-native';\nimport Example from '../../shared/example';\n\nconst CIRCLE_SIZE = 80;\n\nclass DraggableCircle extends React.PureComponent {\n  _panResponder = {};\n  _previousLeft = 0;\n  _previousTop = 0;\n  _circleStyles = {};\n  circle = null;\n\n  constructor() {\n    super();\n    this._panResponder = PanResponder.create({\n      onStartShouldSetPanResponder: this._handleStartShouldSetPanResponder,\n      onMoveShouldSetPanResponder: this._handleMoveShouldSetPanResponder,\n      onPanResponderGrant: this._handlePanResponderGrant,\n      onPanResponderMove: this._handlePanResponderMove,\n      onPanResponderRelease: this._handlePanResponderEnd,\n      onPanResponderTerminate: this._handlePanResponderEnd\n    });\n    this._previousLeft = 20;\n    this._previousTop = 84;\n    this._circleStyles = {\n      left: this._previousLeft,\n      top: this._previousTop,\n      backgroundColor: 'green'\n    };\n  }\n\n  componentDidMount() {\n    this._updateNativeStyles();\n  }\n\n  render() {\n    return (\n      <View style={styles.container}>\n        <View\n          ref={this._setCircleRef}\n          style={[styles.circle, this._circleStyles]}\n          {...this._panResponder.panHandlers}\n        />\n      </View>\n    );\n  }\n\n  _setCircleRef = (circle) => {\n    this.circle = circle;\n  };\n\n  _highlight() {\n    this._circleStyles.backgroundColor = 'blue';\n    this._updateNativeStyles();\n  }\n\n  _unHighlight() {\n    this._circleStyles.backgroundColor = 'green';\n    this._updateNativeStyles();\n  }\n\n  _updateNativeStyles() {\n    this.forceUpdate();\n  }\n\n  _handleStartShouldSetPanResponder = (\n    e: Object,\n    gestureState: Object\n  ): boolean => {\n    // Should we become active when the user presses down on the circle?\n    return true;\n  };\n\n  _handleMoveShouldSetPanResponder = (\n    e: Object,\n    gestureState: Object\n  ): boolean => {\n    // Should we become active when the user moves a touch over the circle?\n    return true;\n  };\n\n  _handlePanResponderGrant = (e: Object, gestureState: Object) => {\n    this._highlight();\n  };\n\n  _handlePanResponderMove = (e: Object, gestureState: Object) => {\n    this._circleStyles.left = this._previousLeft + gestureState.dx;\n    this._circleStyles.top = this._previousTop + gestureState.dy;\n    this._updateNativeStyles();\n  };\n\n  _handlePanResponderEnd = (e: Object, gestureState: Object) => {\n    this._unHighlight();\n    this._previousLeft += gestureState.dx;\n    this._previousTop += gestureState.dy;\n  };\n}\n\nclass LocationXY extends React.Component {\n  constructor() {\n    super();\n    this.state = { translateX: 0 };\n    this.panResponder = PanResponder.create({\n      onStartShouldSetPanResponder: () => true,\n      onStartShouldSetPanResponderCapture: () => true,\n      onPanResponderMove: this._handlePanResponderMove,\n      onPanResponderTerminationRequest: () => true\n    });\n  }\n\n  _handlePanResponderMove = (e, gestureState) => {\n    console.log(e.nativeEvent.locationX, e.nativeEvent.locationY);\n    this.setState((state) => ({\n      ...state,\n      translateX: gestureState.dx\n    }));\n  };\n\n  render() {\n    const transform = { transform: `translateX(${this.state.translateX}px)` };\n    return (\n      <View style={styles.box}>\n        <View style={styles.outer} {...this.panResponder.panHandlers}>\n          <View style={[styles.inner, transform]} />\n        </View>\n      </View>\n    );\n  }\n}\n\nconst styles = StyleSheet.create({\n  circle: {\n    width: CIRCLE_SIZE,\n    height: CIRCLE_SIZE,\n    borderRadius: CIRCLE_SIZE / 2,\n    position: 'absolute',\n    left: 0,\n    top: 0,\n    touchAction: 'none'\n  },\n  container: {\n    alignSelf: 'stretch',\n    minHeight: 300,\n    paddingTop: 64\n  },\n  box: {\n    justifyContent: 'center',\n    alignItems: 'center'\n  },\n  outer: {\n    width: 250,\n    height: 50,\n    backgroundColor: 'skyblue'\n  },\n  inner: {\n    width: 30,\n    height: 30,\n    backgroundColor: 'lightblue'\n  }\n});\n\nexport default function PanResponderPage() {\n  return (\n    <Example title=\"PanResponder\">\n      <DraggableCircle />\n      <LocationXY />\n    </Example>\n  );\n}\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/pressable/index.js",
    "content": "import React from 'react';\nimport { ScrollView, StyleSheet, View, Text, Pressable } from 'react-native';\nimport Button from '../../shared/button';\nimport Example from '../../shared/example';\n\nexport default function PressablePage() {\n  const [eventLog, updateEventLog] = React.useState([]);\n  const [disabled, setDisabled] = React.useState(false);\n  const [delay, setDelay] = React.useState(0);\n\n  const handleEvent = (eventName) => {\n    return () => {\n      const limit = 10;\n      updateEventLog((state) => {\n        const nextState = state.slice(0, limit - 1);\n        nextState.unshift(eventName);\n        return nextState;\n      });\n    };\n  };\n\n  return (\n    <Example title=\"Pressable\">\n      <View style={styles.container}>\n        <Pressable\n          delayLongPress=\"750\"\n          delayPressIn={delay}\n          delayPressOut={delay}\n          disabled={disabled}\n          onBlur={handleEvent('onBlur')}\n          onFocus={handleEvent('onFocus')}\n          onHoverIn={handleEvent('onHoverIn')}\n          onHoverOut={handleEvent('onHoverOut')}\n          onKeyDown={(e) => {\n            console.log(e.key);\n          }}\n          onLongPress={handleEvent('onLongPress - 750ms delay')}\n          onPress={handleEvent(`onPress - ${delay}ms delay`)}\n          onPressIn={handleEvent(`onPressIn - ${delay}ms delay`)}\n          onPressOut={handleEvent(`oPressOut - ${delay}ms delay`)}\n          role=\"button\"\n          style={(state) => [\n            styles.pressable,\n            !disabled && state.focused && styles.focused,\n            !disabled && state.hovered && styles.hovered,\n            !disabled && state.pressed && styles.pressed,\n            disabled && styles.disabled\n          ]}\n        >\n          <Text>Pressable</Text>\n        </Pressable>\n\n        <View style={styles.buttons}>\n          <Button\n            onPress={() => setDisabled((state) => !state)}\n            title={disabled ? 'Enable' : 'Disable'}\n          />\n          <View style={{ width: '1rem' }} />\n          <Button\n            onPress={() => setDelay((state) => (state === 0 ? 350 : 0))}\n            title={delay === 0 ? 'Add delay' : 'Remove delay'}\n          />\n        </View>\n\n        <ScrollView style={styles.eventLogBox}>\n          {eventLog.map((e, i) => (\n            <Text key={i}>{e}</Text>\n          ))}\n        </ScrollView>\n      </View>\n    </Example>\n  );\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    maxWidth: 500,\n    padding: '1rem',\n    width: '100%'\n  },\n  pressable: {\n    borderRadius: 5,\n    padding: 10,\n    borderWidth: 1,\n    outlineWidth: 0,\n    backgroundColor: '#fff'\n  },\n  hovered: {\n    backgroundColor: '#ddd'\n  },\n  focused: {\n    boxShadow: '0px 0px 0px 1px blue'\n  },\n  pressed: {\n    backgroundColor: 'lightblue'\n  },\n  disabled: {\n    opacity: 0.5\n  },\n  buttons: {\n    flexDirection: 'row',\n    marginVertical: '1rem'\n  },\n  eventLogBox: {\n    padding: 10,\n    height: 120,\n    borderWidth: StyleSheet.hairlineWidth,\n    borderColor: '#f0f0f0',\n    backgroundColor: '#f9f9f9'\n  }\n});\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/progress-bar/index.js",
    "content": "import React from 'react';\nimport { ProgressBar, StyleSheet, View } from 'react-native';\nimport Example from '../../shared/example';\n\nfunction Divider() {\n  return <View style={styles.divider} />;\n}\n\nexport default function ProgressBarPage() {\n  return (\n    <Example title=\"ProgressBar\">\n      <View style={styles.container}>\n        <Divider />\n        <ProgressBar indeterminate trackColor=\"#D1E3F6\" />\n        <Divider />\n        <ProgressBar color=\"#1DA1F2\" progress={0.2} />\n        <Divider />\n        <ProgressBar color=\"#17BF63\" progress={0.4} />\n        <Divider />\n        <ProgressBar color=\"#F45D22\" progress={0.6} />\n        <Divider />\n        <ProgressBar color=\"#794BC4\" progress={0.8} />\n        <Divider />\n        <ProgressBar color=\"#E0245E\" progress={1} />\n        <Divider />\n        <ProgressBar\n          color=\"rgb(23, 191, 99)\"\n          progress={0.1}\n          trackColor=\"rgba(23, 191, 99, 0.3)\"\n        />\n        <Divider />\n        <ProgressBar\n          color=\"rgb(244, 93, 34)\"\n          progress={0.2}\n          trackColor=\"rgba(244, 93, 34, 0.3)\"\n        />\n        <Divider />\n        <ProgressBar\n          color=\"rgb(121, 75, 196)\"\n          progress={0.3}\n          trackColor=\"rgba(121, 75, 196, 0.3)\"\n        />\n        <Divider />\n        <ProgressBar\n          color=\"#1DA1F2\"\n          progress={0.33}\n          style={styles.custom}\n          trackColor=\"#D1E3F6\"\n        />\n      </View>\n    </Example>\n  );\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    alignSelf: 'stretch',\n    padding: '1rem'\n  },\n  divider: {\n    height: '1rem'\n  },\n  custom: {\n    borderRadius: 10,\n    height: 20\n  }\n});\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/scroll-view/index.js",
    "content": "import React from 'react';\nimport { ScrollView, StyleSheet, Text, Pressable, View } from 'react-native';\nimport Button from '../../shared/button';\nimport Example from '../../shared/example';\n\nconst ITEMS = [...Array(12)].map((_, i) => `Item ${i}`);\n\nfunction createItemRow(msg, index) {\n  return (\n    <Pressable key={index} style={[styles.item]}>\n      <Text style={styles.text}>{msg}</Text>\n    </Pressable>\n  );\n}\n\nfunction Divider() {\n  return <View style={styles.divider} />;\n}\n\nexport default function ScrollViewPage() {\n  const [scrollEnabled, setEnabled] = React.useState(true);\n  const [throttle, setThrottle] = React.useState(16);\n  const scrollRef = React.useRef(null);\n\n  return (\n    <Example title=\"ScrollView\">\n      <View style={styles.container}>\n        <ScrollView\n          onScroll={() => {\n            console.log('onScroll');\n          }}\n          ref={scrollRef}\n          scrollEnabled={scrollEnabled}\n          scrollEventThrottle={throttle}\n          style={[styles.scrollView, !scrollEnabled && styles.disabled]}\n        >\n          {ITEMS.map(createItemRow)}\n        </ScrollView>\n\n        <View style={styles.buttons}>\n          <Button\n            onPress={() => {\n              setEnabled((val) => !val);\n            }}\n            title={scrollEnabled ? 'Disable' : 'Enable'}\n          />\n          <Divider />\n          <Button\n            onPress={() => {\n              setThrottle((val) => (val !== 16 ? 16 : 1000));\n            }}\n            title=\"Throttle\"\n          />\n        </View>\n        <View style={styles.buttons}>\n          <Button\n            onPress={() => {\n              scrollRef.current.scrollTo({ y: 0 });\n            }}\n            title=\"To start\"\n          />\n          <Divider />\n          <Button\n            onPress={() => {\n              scrollRef.current.scrollTo({ y: 50 });\n            }}\n            title=\"To 50px\"\n          />\n          <Divider />\n          <Button\n            onPress={() => {\n              scrollRef.current.scrollToEnd({ animated: true });\n            }}\n            title=\"To end\"\n          />\n        </View>\n      </View>\n    </Example>\n  );\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    alignSelf: 'stretch'\n  },\n  scrollView: {\n    backgroundColor: '#eeeeee',\n    maxHeight: 250\n  },\n  disabled: {\n    opacity: 0.5\n  },\n  item: {\n    margin: 5,\n    padding: 5,\n    backgroundColor: '#cccccc',\n    borderRadius: 3,\n    minWidth: 96\n  },\n  text: {\n    fontSize: 16,\n    fontWeight: 'bold',\n    margin: 5\n  },\n  buttons: {\n    flexDirection: 'row',\n    justifyContent: 'center',\n    marginVertical: '1rem'\n  },\n  divider: {\n    width: '1rem'\n  }\n});\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/section-list/index.js",
    "content": "import React from 'react';\nimport { StyleSheet } from 'react-native';\nimport Example from '../../shared/example';\nimport { SectionList, Text, View } from 'react-native-web';\n\nfunction makeItems(length) {\n  return Array(length)\n    .fill(0)\n    .map((value, index) => ({\n      key: `item_${index}`,\n      title: `Item ${index}`\n    }));\n}\n\nconst sectionsData = [\n  { data: makeItems(9), title: 'Section A', color: 'red', key: 'a' },\n  { data: makeItems(6), title: 'Section B', color: 'green', key: 'b' },\n  { data: makeItems(3), title: 'Section C', color: 'yellow', key: 'c' }\n];\n\nfunction renderItem({ item }) {\n  return (\n    <Text key={item.key} style={styles.itemTitleText}>\n      {item.title}\n    </Text>\n  );\n}\n\nfunction renderSectionHeader({ section }) {\n  const extraStyle = { backgroundColor: section.color };\n  return (\n    <Text\n      key={`sh_${section.key}`}\n      style={[styles.sectionHeaderText, extraStyle]}\n    >\n      {section.title}\n    </Text>\n  );\n}\n\nfunction renderSectionFooter({ section }) {\n  const footerStyle = {\n    height: 10,\n    backgroundColor: section.color,\n    marginBottom: 10\n  };\n  return <View key={`sf_${section.key}`} style={footerStyle} />;\n}\n\nexport default function SectionListPage() {\n  return (\n    <Example title=\"SectionList\">\n      <SectionList\n        ListFooterComponent={\n          <Text style={styles.examplesFooter}>\n            (Example ListFooterComponent Here)\n          </Text>\n        }\n        ListHeaderComponent={\n          <Text style={styles.examplesHeader}>\n            (Example ListHeaderComponent Here)\n          </Text>\n        }\n        renderItem={renderItem}\n        renderSectionFooter={renderSectionFooter}\n        renderSectionHeader={renderSectionHeader}\n        sections={sectionsData}\n      />\n    </Example>\n  );\n}\n\nconst styles = StyleSheet.create({\n  examplesFooter: { fontSize: 22 },\n  examplesHeader: { fontSize: 22, marginBottom: 20 },\n  itemTitleText: { fontSize: 16 },\n  sectionHeaderText: { fontSize: 20, fontWeight: 'bold' }\n});\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/switch/index.js",
    "content": "import React from 'react';\nimport { StyleSheet, Switch, View } from 'react-native';\nimport Example from '../../shared/example';\n\nfunction Divider() {\n  return <View style={styles.divider} />;\n}\n\nexport default function SwitchPage() {\n  const [checked, setChecked] = React.useState(true);\n\n  React.useEffect(() => {\n    const interval = setInterval(() => {\n      setChecked(!checked);\n    }, 2500);\n    return () => {\n      clearInterval(interval);\n    };\n  }, [checked]);\n\n  return (\n    <Example title=\"Switch\">\n      <View style={styles.row}>\n        <Switch disabled={true} value={false} />\n        <Divider />\n        <Switch disabled={true} value={true} />\n        <Divider />\n        <Switch\n          activeThumbColor=\"#fff\"\n          activeTrackColor=\"#E0245E\"\n          disabled={true}\n          value={true}\n        />\n        <Divider />\n        <Switch\n          disabled={true}\n          thumbColor=\"#fff\"\n          trackColor=\"#E0245E\"\n          value={false}\n        />\n        <Divider />\n        <Switch\n          disabled={true}\n          trackColor={{ true: '#E0245E', false: '#1DA1F2' }}\n          value={false}\n        />\n        <Divider />\n        <Switch\n          disabled={true}\n          trackColor={{ true: '#E0245E', false: '#1DA1F2' }}\n          value={true}\n        />\n      </View>\n      <View style={styles.row}>\n        <Switch value={false} />\n        <Divider />\n        <Switch value={true} />\n      </View>\n      <View style={styles.row}>\n        <Switch\n          activeThumbColor=\"#1DA1F2\"\n          activeTrackColor=\"#ccc\"\n          value={true}\n        />\n        <Divider />\n        <Switch\n          activeThumbColor=\"#17BF63\"\n          activeTrackColor=\"#ccc\"\n          value={true}\n        />\n        <Divider />\n        <Switch\n          activeThumbColor=\"#FFAD1F\"\n          activeTrackColor=\"#ccc\"\n          value={true}\n        />\n        <Divider />\n        <Switch\n          activeThumbColor=\"#F45D22\"\n          activeTrackColor=\"#ccc\"\n          value={true}\n        />\n        <Divider />\n        <Switch\n          activeThumbColor=\"#794BC4\"\n          activeTrackColor=\"#ccc\"\n          value={true}\n        />\n        <Divider />\n        <Switch\n          activeThumbColor=\"#E0245E\"\n          activeTrackColor=\"#ccc\"\n          value={true}\n        />\n      </View>\n      <View style={styles.row}>\n        <Switch\n          activeThumbColor=\"#fff\"\n          activeTrackColor=\"#1DA1F2\"\n          value={true}\n        />\n        <Divider />\n        <Switch\n          activeThumbColor=\"#fff\"\n          activeTrackColor=\"#17BF63\"\n          value={true}\n        />\n        <Divider />\n        <Switch\n          activeThumbColor=\"#fff\"\n          activeTrackColor=\"#FFAD1F\"\n          value={true}\n        />\n        <Divider />\n        <Switch\n          activeThumbColor=\"#fff\"\n          activeTrackColor=\"#F45D22\"\n          value={true}\n        />\n        <Divider />\n        <Switch\n          activeThumbColor=\"#fff\"\n          activeTrackColor=\"#794BC4\"\n          value={true}\n        />\n        <Divider />\n        <Switch\n          activeThumbColor=\"#fff\"\n          activeTrackColor=\"#E0245E\"\n          value={true}\n        />\n      </View>\n      <View style={styles.row}>\n        <Switch activeTrackColor=\"#ccc\" thumbColor=\"#1DA1F2\" value={false} />\n        <Divider />\n        <Switch activeTrackColor=\"#ccc\" thumbColor=\"#17BF63\" value={false} />\n        <Divider />\n        <Switch activeTrackColor=\"#ccc\" thumbColor=\"#FFAD1F\" value={false} />\n        <Divider />\n        <Switch activeTrackColor=\"#ccc\" thumbColor=\"#F45D22\" value={false} />\n        <Divider />\n        <Switch activeTrackColor=\"#ccc\" thumbColor=\"#794BC4\" value={false} />\n        <Divider />\n        <Switch activeTrackColor=\"#ccc\" thumbColor=\"#E0245E\" value={false} />\n      </View>\n      <View style={styles.row}>\n        <Switch thumbColor=\"#fff\" trackColor=\"#1DA1F2\" value={false} />\n        <Divider />\n        <Switch thumbColor=\"#fff\" trackColor=\"#17BF63\" value={false} />\n        <Divider />\n        <Switch thumbColor=\"#fff\" trackColor=\"#FFAD1F\" value={false} />\n        <Divider />\n        <Switch thumbColor=\"#fff\" trackColor=\"#F45D22\" value={false} />\n        <Divider />\n        <Switch thumbColor=\"#fff\" trackColor=\"#794BC4\" value={false} />\n        <Divider />\n        <Switch thumbColor=\"#fff\" trackColor=\"#E0245E\" value={false} />\n      </View>\n\n      <View style={styles.row}>\n        <Switch\n          style={{ height: 32, width: 32 }}\n          thumbColor=\"#1DA1F2\"\n          value={checked}\n        />\n      </View>\n    </Example>\n  );\n}\n\nconst styles = StyleSheet.create({\n  row: {\n    alignItems: 'center',\n    flexDirection: 'row',\n    marginVertical: 20\n  },\n  divider: {\n    width: 10\n  }\n});\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/text/index.js",
    "content": "import React from 'react';\nimport { Image, Text, View } from 'react-native';\nimport Example from '../../shared/example';\n\nconst Spacer = () => <View style={{ height: '1rem' }} />;\n\nconst Heading = ({ children }) => (\n  <Text\n    children={children}\n    role=\"heading\"\n    style={{ fontSize: '1rem', fontWeight: 'bold', marginBottom: '0.5rem' }}\n  />\n);\n\nfunction Color() {\n  return (\n    <View>\n      <Heading>color</Heading>\n      <Text style={{ color: 'red' }}>Red color</Text>\n      <Text style={{ color: 'blue' }}>Blue color</Text>\n    </View>\n  );\n}\n\nfunction FontFamily() {\n  return (\n    <View>\n      <Heading>fontFamily</Heading>\n      <Text style={{ fontFamily: 'Cochin' }}>Cochin</Text>\n      <Text\n        style={{\n          fontFamily: 'Cochin',\n          fontWeight: 'bold'\n        }}\n      >\n        Cochin bold\n      </Text>\n      <Text style={{ fontFamily: 'Helvetica' }}>Helvetica</Text>\n      <Text style={{ fontFamily: 'Helvetica', fontWeight: 'bold' }}>\n        Helvetica bold\n      </Text>\n      <Text style={{ fontFamily: 'Verdana' }}>Verdana</Text>\n      <Text\n        style={{\n          fontFamily: 'Verdana',\n          fontWeight: 'bold'\n        }}\n      >\n        Verdana bold\n      </Text>\n    </View>\n  );\n}\n\nfunction FontSize() {\n  return (\n    <View>\n      <Heading>fontSize</Heading>\n      <Text style={{ fontSize: 23 }}>Size 23</Text>\n      <Text style={{ fontSize: 8 }}>Size 8</Text>\n    </View>\n  );\n}\n\nfunction FontStyle() {\n  return (\n    <View>\n      <Heading>fontStyle</Heading>\n      <Text style={{ fontStyle: 'normal' }}>Normal text</Text>\n      <Text style={{ fontStyle: 'italic' }}>Italic text</Text>\n    </View>\n  );\n}\n\nfunction FontVariant() {\n  return (\n    <View>\n      <Heading>fontVariant</Heading>\n      <Text style={{ fontVariant: 'small-caps' }}>Small Caps{'\\n'}</Text>\n      <Text\n        style={{\n          fontVariant: 'oldstyle-nums'\n        }}\n      >\n        Old Style nums 0123456789{'\\n'}\n      </Text>\n      <Text\n        style={{\n          fontVariant: 'lining-nums'\n        }}\n      >\n        Lining nums 0123456789{'\\n'}\n      </Text>\n      <Text style={{ fontVariant: 'tabular-nums' }}>\n        Tabular nums{'\\n'}\n        1111{'\\n'}\n        2222{'\\n'}\n      </Text>\n      <Text style={{ fontVariant: 'proportional-nums' }}>\n        Proportional nums{'\\n'}\n        1111{'\\n'}\n        2222{'\\n'}\n      </Text>\n    </View>\n  );\n}\n\nfunction FontWeight() {\n  return (\n    <View>\n      <Heading>fontWeight</Heading>\n      <Text style={{ fontSize: 20, fontWeight: '100' }}>\n        Move fast and be ultralight\n      </Text>\n      <Text style={{ fontSize: 20, fontWeight: '200' }}>\n        Move fast and be light\n      </Text>\n      <Text style={{ fontSize: 20, fontWeight: 'normal' }}>\n        Move fast and be normal\n      </Text>\n      <Text style={{ fontSize: 20, fontWeight: 'bold' }}>\n        Move fast and be bold\n      </Text>\n      <Text style={{ fontSize: 20, fontWeight: '900' }}>\n        Move fast and be ultrabold\n      </Text>\n    </View>\n  );\n}\n\nfunction LetterSpacing() {\n  return (\n    <View>\n      <Heading>letterSpacing</Heading>\n      <Text style={{ letterSpacing: 0 }}>letterSpacing = 0</Text>\n      <Text style={{ letterSpacing: 2, marginTop: 5 }}>letterSpacing = 2</Text>\n      <Text style={{ letterSpacing: 9, marginTop: 5 }}>letterSpacing = 9</Text>\n      <View style={{ flexDirection: 'row' }}>\n        <Text\n          style={{\n            fontSize: 12,\n            letterSpacing: 2,\n            backgroundColor: 'fuchsia',\n            marginTop: 5\n          }}\n        >\n          With size and background color\n        </Text>\n      </View>\n      <Text style={{ letterSpacing: -1, marginTop: 5 }}>\n        letterSpacing = -1\n      </Text>\n      <Text\n        style={{ letterSpacing: 3, backgroundColor: '#dddddd', marginTop: 5 }}\n      >\n        [letterSpacing = 3]\n        <Text style={{ letterSpacing: 0, backgroundColor: '#bbbbbb' }}>\n          [Nested letterSpacing = 0]\n        </Text>\n        <Text style={{ letterSpacing: 6, backgroundColor: '#eeeeee' }}>\n          [Nested letterSpacing = 6]\n        </Text>\n      </Text>\n    </View>\n  );\n}\n\nfunction LineHeight() {\n  return (\n    <View>\n      <Heading>lineHeight</Heading>\n      <Text style={{ lineHeight: 35 }}>\n        A lot of space should display between the lines of this long passage as\n        they wrap across several lines. A lot of space should display between\n        the lines of this long passage as they wrap across several lines.\n      </Text>\n    </View>\n  );\n}\n\nfunction TextAlign() {\n  return (\n    <View>\n      <Heading>textAlign</Heading>\n      <Text>auto (default) - english LTR</Text>\n      <Text>\n        {'\\u0623\\u062D\\u0628 \\u0627\\u0644\\u0644\\u063A\\u0629 ' +\n          '\\u0627\\u0644\\u0639\\u0631\\u0628\\u064A\\u0629 auto (default) - arabic ' +\n          'RTL'}\n      </Text>\n      <Text style={{ textAlign: 'left' }}>\n        left left left left left left left left left left left left left left\n        left\n      </Text>\n      <Text style={{ textAlign: 'center' }}>\n        center center center center center center center center center center\n        center\n      </Text>\n      <Text style={{ textAlign: 'right' }}>\n        right right right right right right right right right right right right\n        right\n      </Text>\n      <Text style={{ textAlign: 'justify' }}>\n        justify: this text component{\"'\"}s contents are laid out with\n        \"textAlign: justify\" and as you can see all of the lines except the last\n        one span the available width of the parent container.\n      </Text>\n    </View>\n  );\n}\n\nfunction TextDecoration() {\n  return (\n    <View>\n      <Heading>textDecoration</Heading>\n      <Text\n        style={{\n          textDecorationLine: 'underline',\n          textDecorationStyle: 'solid'\n        }}\n      >\n        Solid underline\n      </Text>\n      <Text\n        style={{\n          textDecorationLine: 'underline',\n          textDecorationStyle: 'double',\n          textDecorationColor: '#ff0000'\n        }}\n      >\n        Double underline with custom color\n      </Text>\n      <Text\n        style={{\n          textDecorationLine: 'underline',\n          textDecorationStyle: 'dashed',\n          textDecorationColor: '#9CDC40'\n        }}\n      >\n        Dashed underline with custom color\n      </Text>\n      <Text\n        style={{\n          textDecorationLine: 'underline',\n          textDecorationStyle: 'dotted',\n          textDecorationColor: 'blue'\n        }}\n      >\n        Dotted underline with custom color\n      </Text>\n      <Text style={{ textDecorationLine: 'none' }}>None textDecoration</Text>\n      <Text\n        style={{\n          textDecorationLine: 'line-through',\n          textDecorationStyle: 'solid'\n        }}\n      >\n        Solid line-through\n      </Text>\n      <Text\n        style={{\n          textDecorationLine: 'line-through',\n          textDecorationStyle: 'double',\n          textDecorationColor: '#ff0000'\n        }}\n      >\n        Double line-through with custom color\n      </Text>\n      <Text\n        style={{\n          textDecorationLine: 'line-through',\n          textDecorationStyle: 'dashed',\n          textDecorationColor: '#9CDC40'\n        }}\n      >\n        Dashed line-through with custom color\n      </Text>\n      <Text\n        style={{\n          textDecorationLine: 'line-through',\n          textDecorationStyle: 'dotted',\n          textDecorationColor: 'blue'\n        }}\n      >\n        Dotted line-through with custom color\n      </Text>\n      <Text style={{ textDecorationLine: 'underline line-through' }}>\n        Both underline and line-through\n      </Text>\n    </View>\n  );\n}\n\nfunction TextShadow() {\n  return (\n    <View>\n      <Heading>textShadow*</Heading>\n      <Text\n        style={{\n          fontSize: 20,\n          textShadow: '2px 2px 1px #00cccc'\n        }}\n      >\n        Text shadow example\n      </Text>\n    </View>\n  );\n}\n\nfunction LineExample({ description, children }) {\n  return (\n    <View style={{ marginTop: 20 }}>\n      <Text style={{ color: 'gray', marginBottom: 5 }}>{description}</Text>\n\n      <View\n        style={{\n          borderWidth: 2,\n          borderColor: 'black',\n          width: 200\n        }}\n      >\n        {children}\n      </View>\n    </View>\n  );\n}\n\nexport default function TextPage() {\n  return (\n    <Example title=\"Text\">\n      <View style={{ maxWidth: 500 }}>\n        <Text>\n          Text wraps across multiple lines by default. Text wraps across\n          multiple lines by default. Text wraps across multiple lines by\n          default. Text wraps across multiple lines by default.\n        </Text>\n\n        <Spacer />\n\n        <Text>\n          (Text inherits styles from parent Text elements,\n          <Text style={{ fontWeight: 'bold' }}>\n            {'\\n  '}\n            (for example this text is bold\n            <Text style={{ fontSize: 11, color: '#527fe4' }}>\n              {'\\n    '}\n              (and this text inherits the bold while setting size and color)\n            </Text>\n            {'\\n  '})\n          </Text>\n          {'\\n'})\n        </Text>\n\n        <Spacer />\n\n        <Text style={{ opacity: 0.7 }}>\n          (Text opacity\n          <Text>\n            {'\\n  '}\n            (is inherited\n            <Text style={{ opacity: 0.7 }}>\n              {'\\n    '}\n              (and accumulated\n              <Text style={{ backgroundColor: '#ffaaaa' }}>\n                {'\\n      '}\n                (and also applies to the background)\n              </Text>\n              {'\\n    '})\n            </Text>\n            {'\\n  '})\n          </Text>\n          {'\\n'})\n        </Text>\n\n        <Spacer />\n\n        <Text>\n          This text contains an inline blue view{' '}\n          <View\n            style={{ width: 25, height: 25, backgroundColor: 'steelblue' }}\n          />{' '}\n          and an inline image{' '}\n          <Image\n            resizeMode=\"cover\"\n            source={{ uri: 'http://lorempixel.com/30/11' }}\n            style={{ width: 30, height: 11 }}\n          />\n          .\n        </Text>\n\n        <Spacer />\n\n        <Text>\n          This text contains a view{' '}\n          <View style={{ borderColor: 'red', borderWidth: 1 }}>\n            <Text style={{ borderColor: 'blue', borderWidth: 1 }}>\n              which contains\n            </Text>\n            <Text style={{ borderColor: 'green', borderWidth: 1 }}>\n              another text.\n            </Text>\n            <Text style={{ borderColor: 'yellow', borderWidth: 1 }}>\n              And contains another view\n              <View style={{ borderColor: 'red', borderWidth: 1 }}>\n                <Text style={{ borderColor: 'blue', borderWidth: 1 }}>\n                  which contains another text!\n                </Text>\n              </View>\n            </Text>\n          </View>{' '}\n          And then continues as text.\n        </Text>\n\n        <Text>\n          This text is <Text style={{ fontWeight: 'bold' }}>selectable</Text> if\n          you click-and-hold.\n        </Text>\n        <Text>\n          This text is{' '}\n          <Text style={{ fontWeight: 'bold', userSelect: 'none' }}>\n            not selectable\n          </Text>{' '}\n          if you click-and-hold.\n        </Text>\n\n        <View style={{ paddingVertical: 20 }}>\n          <LineExample description=\"With no line breaks, text is limited to 2 lines.\">\n            <Text numberOfLines={2}>\n              {\n                'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'\n              }\n            </Text>\n          </LineExample>\n\n          <LineExample description=\"With line breaks, text is limited to 2 lines.\">\n            <Text numberOfLines={2}>\n              {\n                'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\\nExcepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'\n              }\n            </Text>\n          </LineExample>\n\n          <LineExample description=\"With no line breaks, text is limited to 1 line.\">\n            <Text numberOfLines={1}>\n              {\n                'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'\n              }\n            </Text>\n          </LineExample>\n\n          <LineExample description=\"With line breaks, text is limited to 1 line.\">\n            <Text numberOfLines={1}>\n              {\n                'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\\nExcepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'\n              }\n            </Text>\n          </LineExample>\n\n          <LineExample description=\"With very long word, text is limited to 1 line and long word is truncated.\">\n            <Text numberOfLines={1}>\n              goal aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n            </Text>\n          </LineExample>\n\n          <LineExample description=\"With space characters within adjacent truncated lines\">\n            <View style={{ display: 'flex', flexDirection: 'row' }}>\n              <Text numberOfLines={1}>\n                <Text>Spaces </Text>\n                <Text>between</Text>\n                <Text> words</Text>\n              </Text>\n            </View>\n            <View style={{ display: 'flex', flexDirection: 'row' }}>\n              <Text>Spaces </Text>\n              <Text>between</Text>\n              <Text> words</Text>\n            </View>\n          </LineExample>\n        </View>\n\n        <View>\n          <Color />\n          <Spacer />\n\n          <FontFamily />\n          <Spacer />\n\n          <FontSize />\n          <Spacer />\n\n          <FontStyle />\n          <Spacer />\n\n          <FontVariant />\n          <Spacer />\n\n          <FontWeight />\n          <Spacer />\n\n          <LetterSpacing />\n          <Spacer />\n\n          <LineHeight />\n          <Spacer />\n\n          <TextAlign />\n          <Spacer />\n\n          <TextDecoration />\n          <Spacer />\n\n          <TextShadow />\n        </View>\n      </View>\n    </Example>\n  );\n}\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/text-input/index.js",
    "content": "import React from 'react';\nimport { StyleSheet, TextInput, View } from 'react-native';\nimport Example from '../../shared/example';\n\nexport default function TextInputPage() {\n  const nextFocus = React.useRef(null);\n\n  const focusNextField = () => {\n    if (nextFocus.current != null) {\n      nextFocus.current.focus();\n    }\n  };\n\n  return (\n    <Example title=\"TextInput\">\n      <View style={styles.container}>\n        <TextInput\n          autoFocus\n          onFocus={() => {\n            console.log('focused');\n          }}\n          style={styles.textinput}\n        />\n        <TextInput\n          blurOnSubmit={true}\n          onSubmitEditing={() => focusNextField()}\n          placeholder=\"blurOnSubmit\"\n          style={styles.textinput}\n        />\n        <TextInput\n          clearTextOnFocus={true}\n          defaultValue=\"clearTextOnFocus\"\n          ref={nextFocus}\n          style={styles.textinput}\n        />\n        <TextInput\n          defaultValue=\"disabled\"\n          disabled={true}\n          style={styles.textinput}\n        />\n        <TextInput\n          defaultValue=\"readOnly (true)\"\n          readOnly={true}\n          style={styles.textinput}\n        />\n        <TextInput\n          inputMode=\"numeric\"\n          placeholder=\"inputMode 'numeric'\"\n          style={styles.textinput}\n        />\n        <TextInput\n          maxLength={5}\n          placeholder=\"maxLength\"\n          style={styles.textinput}\n        />\n\n        <TextInput\n          placeholder=\"placeholderTextColor\"\n          placeholderTextColor=\"orange\"\n          style={styles.textinput}\n        />\n        <TextInput\n          defaultValue=\"selectTextOnFocus\"\n          selectTextOnFocus={true}\n          style={styles.textinput}\n        />\n        <TextInput\n          defaultValue=\"secureTextEntry\"\n          secureTextEntry={true}\n          style={styles.textinput}\n        />\n        <TextInput\n          multiline={true}\n          placeholder=\"multiline\"\n          rows={3}\n          style={styles.multiline}\n        />\n        <TextInput\n          caretHidden\n          defaultValue=\"caretHidden\"\n          style={styles.textinput}\n        />\n      </View>\n    </Example>\n  );\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    alignSelf: 'stretch',\n    padding: '1rem'\n  },\n  textinput: {\n    height: 26,\n    borderWidth: 0.5,\n    borderColor: '#0f0f0f',\n    padding: 4,\n    marginVertical: '1rem'\n  },\n  multiline: {\n    borderWidth: 0.5,\n    borderColor: '#0f0f0f',\n    padding: 4,\n    marginVertical: '1rem'\n  }\n});\n"
  },
  {
    "path": "packages/react-native-web-examples/pages/view/index.js",
    "content": "import React from 'react';\nimport { StyleSheet, Text, Pressable, View } from 'react-native';\nimport Example from '../../shared/example';\n\nconst log = (...msg) => {\n  console.log(...msg);\n};\n\nconst l1 = { width: '100%', paddingLeft: 0, paddingTop: 0 };\nconst l2 = { width: '75%', paddingLeft: 10, paddingTop: 10 };\n\nfunction Box({ pointerEvents }) {\n  return (\n    <Pressable\n      onPress={log}\n      style={({ pressed }) => [\n        styles.box,\n        pressed && styles.purple,\n        pointerEventsStyles[pointerEvents]\n      ]}\n    >\n      <Pressable\n        onPress={log}\n        style={({ pressed }) => [styles.content, pressed && styles.orange]}\n      >\n        <Text>{pointerEvents}</Text>\n      </Pressable>\n    </Pressable>\n  );\n}\n\nexport default function ViewPage() {\n  const [layoutInfo, setLayoutInfo] = React.useState({});\n  const [layoutStyle, setLayoutStyle] = React.useState(l1);\n\n  React.useEffect(() => {\n    const interval = setInterval(() => {\n      setLayoutStyle((l) => (l.width === '100%' ? l2 : l1));\n    }, 2500);\n    return () => {\n      clearInterval(interval);\n    };\n  }, []);\n\n  const handleLayout = ({ nativeEvent }) => {\n    setLayoutInfo(() => ({ ...nativeEvent.layout }));\n  };\n\n  return (\n    <Example title=\"View\">\n      <View style={styles.container}>\n        <Text role=\"heading\" style={styles.heading}>\n          onLayout\n        </Text>\n        <View>\n          <View style={[styles.layoutContainer, layoutStyle]}>\n            <View onLayout={handleLayout} style={styles.layoutBox} />\n          </View>\n          <Text>{JSON.stringify(layoutInfo, null, 2)}</Text>\n        </View>\n\n        <Text role=\"heading\" style={styles.heading}>\n          pointerEvents\n        </Text>\n        <View style={pointerEventsStyles['box-none']}>\n          <View style={[styles.boxContainer, pointerEventsStyles['box-none']]}>\n            <Box pointerEvents=\"none\" />\n            <Box pointerEvents=\"auto\" />\n            <Box pointerEvents=\"box-only\" />\n            <Box pointerEvents=\"box-none\" />\n          </View>\n        </View>\n      </View>\n    </Example>\n  );\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    alignSelf: 'stretch',\n    padding: 10\n  },\n  heading: {\n    fontWeight: 'bold',\n    marginVertical: '1rem'\n  },\n  layoutContainer: {\n    marginBottom: '1rem'\n  },\n  layoutBox: {\n    backgroundColor: '#FFAD1F',\n    height: 50\n  },\n  boxContainer: {\n    height: 50\n  },\n  box: {\n    backgroundColor: '#ececec',\n    padding: 30,\n    marginVertical: 5,\n    userSelect: 'none'\n  },\n  content: {\n    backgroundColor: 'white',\n    padding: 10,\n    borderWidth: 1,\n    borderColor: 'black',\n    borderStyle: 'solid',\n    userSelect: 'none'\n  },\n  orange: {\n    backgroundColor: 'orange'\n  },\n  purple: {\n    backgroundColor: 'purple'\n  }\n});\n\nconst pointerEventsStyles = StyleSheet.create({\n  auto: {\n    pointerEvents: 'auto'\n  },\n  none: {\n    pointerEvents: 'none'\n  },\n  'box-only': {\n    pointerEvents: 'box-only'\n  },\n  'box-none': {\n    pointerEvents: 'box-none'\n  }\n});\n"
  },
  {
    "path": "packages/react-native-web-examples/sandbox.config.json",
    "content": "{\n  \"container\": {\n    \"node\": \"16\"\n  }\n}\n"
  },
  {
    "path": "packages/react-native-web-examples/shared/button.js",
    "content": "import { StyleSheet, Text, Pressable } from 'react-native';\n\nexport default function Button(props) {\n  const { title, ...other } = props;\n  return (\n    <Pressable {...other} style={styles.button}>\n      <Text style={styles.buttonText}>{title}</Text>\n    </Pressable>\n  );\n}\n\nconst styles = StyleSheet.create({\n  button: {\n    backgroundColor: 'lightblue',\n    borderRadius: 10,\n    paddingBlock: 5,\n    paddingInline: 10\n  },\n  buttonText: {\n    fontWeight: 'bold',\n    textTransform: 'uppercase'\n  }\n});\n"
  },
  {
    "path": "packages/react-native-web-examples/shared/example.js",
    "content": "import { StyleSheet, Text, View } from 'react-native';\n\nexport default function Example(props) {\n  return (\n    <View style={styles.root}>\n      <View style={styles.header}>\n        <Text aria-label=\"Back\" href=\"/\" style={styles.back}>\n          <svg\n            style={{ fill: '#555', height: '100%' }}\n            viewBox=\"0 0 140 140\"\n            xmlns=\"http://www.w3.org/2000/svg\"\n          >\n            <path d=\"M105.614 118.681c3.398 3.396 3.4 8.912 0 12.311-3.396 3.399-8.91 3.398-12.311 0-.02-.02-.035-.04-.053-.061l-.025.022-57.66-57.66.024-.022a8.664 8.664 0 01-2.608-6.208 8.672 8.672 0 013.229-6.762l-.06-.058 57.66-57.66.025.024c.018-.021.033-.039.053-.058A8.706 8.706 0 01106.2 14.86c-.021.02-.041.034-.061.054l.023.024-52.119 52.125 51.54 51.54-.025.021c.015.022.036.036.056.057\" />\n          </svg>\n        </Text>\n        <Text role=\"heading\" style={styles.title}>\n          {props.title}\n        </Text>\n      </View>\n      <View style={styles.container}>{props.children}</View>\n    </View>\n  );\n}\n\nconst styles = StyleSheet.create({\n  root: {\n    height: '100vh'\n  },\n  header: {\n    paddingVertical: '1em',\n    borderBottomColor: '#ccc',\n    borderBottomWidth: 1\n  },\n  title: {\n    fontSize: 18,\n    fontWeight: 'bold',\n    textAlign: 'center'\n  },\n  back: {\n    position: 'absolute',\n    height: '100%',\n    display: 'flex',\n    padding: 10,\n    left: 0,\n    top: 0,\n    width: 40,\n    alignItems: 'center'\n  },\n  container: {\n    alignItems: 'center',\n    flex: 1,\n    overflowY: 'scroll'\n  }\n});\n"
  },
  {
    "path": "scripts/createBabelReactNativeWebModuleMap.js",
    "content": "/**\n * Creates a map of exported modules, allowing the RNW babel plugin to rewrite\n * paths only for modules it knows are exported by RNW.\n */\nconst fs = require('fs');\nconst path = require('path');\n\nconst isDirectory = (source) => fs.lstatSync(source).isDirectory();\nconst getDirectories = (source) =>\n  fs.readdirSync(source).filter((name) => isDirectory(path.join(source, name)));\n\nconst packagesDir = path.join(__dirname, '../packages/');\nconst exportsDir = path.join(packagesDir, 'react-native-web/src/exports');\nconst moduleMapOutfile = path.join(\n  packagesDir,\n  'babel-plugin-react-native-web/src/moduleMap.js'\n);\n\nconst moduleMap = getDirectories(exportsDir).reduce((acc, curr) => {\n  acc[curr] = true;\n  return acc;\n}, {});\n\nconst data = `// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.\nmodule.exports = ${JSON.stringify(moduleMap, null, 2)}`;\n\nfs.writeFileSync(moduleMapOutfile, data);\n"
  },
  {
    "path": "scripts/createInlineStylePrefixerData.js",
    "content": "'use strict';\n\nconst generator = require('inline-style-prefixer/lib/generator').default;\nconst path = require('path');\n\nconst browserList = {\n  and_chr: 49,\n  chrome: 49,\n  edge: 79,\n  firefox: 52,\n  ios_saf: 11,\n  opera: 50,\n  safari: 11\n};\n\ngenerator(browserList, {\n  path: path.join(\n    __dirname,\n    '../packages/react-native-web/src/modules/prefixStyles/static.js'\n  )\n});\n"
  },
  {
    "path": "scripts/releaseReactNativeWebPackages.js",
    "content": "#!/usr/bin/env node\n\n'use strict';\n\nconst execSync = require('child_process').execSync;\nconst fs = require('fs');\nconst glob = require('glob');\nconst minimist = require('minimist');\nconst path = require('path');\n\nconst args = process.argv.slice(2);\nconst argv = minimist(args);\n\nconst version = argv._[0];\nconst skipGit = argv['skip-git'];\nconst oneTimeCode = argv.otp;\n\nconsole.log(`Publishing react-native-web@${version}`);\n\n// Collect 'react-native-web' workspaces and package manifests\nconst workspacePaths = require('../package.json').workspaces.reduce(\n  (acc, w) => {\n    const resolvedPaths = glob.sync(w);\n    resolvedPaths.forEach((p) => {\n      // Remove duplicates and unrelated packages\n      if (p.includes('react-native-web') && acc.indexOf(p) === -1) {\n        acc.push(p);\n      }\n    });\n    return acc;\n  },\n  []\n);\n\nconst workspaces = workspacePaths.map((dir) => {\n  const directory = path.resolve(dir);\n  const packageJsonPath = path.join(directory, 'package.json');\n  const packageJson = JSON.parse(\n    fs.readFileSync(packageJsonPath, { encoding: 'utf-8' })\n  );\n  return { directory, packageJson, packageJsonPath };\n});\n\n// Update each package version and its dependencies\nconst workspaceNames = workspaces.map(({ packageJson }) => packageJson.name);\nworkspaces.forEach(({ directory, packageJson, packageJsonPath }) => {\n  packageJson.version = version;\n  workspaceNames.forEach((name) => {\n    if (packageJson.dependencies && packageJson.dependencies[name]) {\n      packageJson.dependencies[name] = version;\n    }\n    if (packageJson.devDependencies && packageJson.devDependencies[name]) {\n      packageJson.devDependencies[name] = version;\n    }\n  });\n  fs.writeFileSync(\n    packageJsonPath,\n    JSON.stringify(packageJson, null, 2) + '\\n'\n  );\n});\n\nexecSync('npm install');\n\n// Commit changes\nif (!skipGit) {\n  // add changes\n  execSync('git add .');\n  // commit\n  execSync(`git commit -m \"${version}\" --no-verify`);\n  // tag\n  execSync(`git tag -fam ${version} \"${version}\"`);\n}\n\n// Publish public packages\nworkspaces.forEach(({ directory, packageJson }) => {\n  if (!packageJson.private) {\n    execSync(`cd ${directory} && npm publish --otp ${oneTimeCode}`);\n  }\n});\n\n// Push changes\nif (!skipGit) {\n  execSync('git push --tags origin master');\n}\n"
  }
]